diff --git a/composer.lock b/composer.lock index 3d4726a88..fd4477d6f 100644 --- a/composer.lock +++ b/composer.lock @@ -305,17 +305,17 @@ "source": { "type": "git", "url": "https://github.com/ChristophWurst/nextcloud_composer.git", - "reference": "5e9719488fe558db974ef45f289a6911fe2c6850" + "reference": "309ccfab8b7e842df9f17d6389f190411158bd36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ChristophWurst/nextcloud_composer/zipball/5e9719488fe558db974ef45f289a6911fe2c6850", - "reference": "5e9719488fe558db974ef45f289a6911fe2c6850", + "url": "https://api.github.com/repos/ChristophWurst/nextcloud_composer/zipball/309ccfab8b7e842df9f17d6389f190411158bd36", + "reference": "309ccfab8b7e842df9f17d6389f190411158bd36", "shasum": "" }, "require": { "php": "^7.4 || ~8.0 || ~8.1", - "psr/container": "^1.0", + "psr/container": "^1.1.1", "psr/event-dispatcher": "^1.0", "psr/log": "^1.1" }, @@ -341,7 +341,7 @@ "issues": "https://github.com/ChristophWurst/nextcloud_composer/issues", "source": "https://github.com/ChristophWurst/nextcloud_composer/tree/master" }, - "time": "2022-05-11T02:03:08+00:00" + "time": "2022-07-02T02:10:17+00:00" }, { "name": "composer/package-versions-deprecated", @@ -5473,5 +5473,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 3d3cd7ffb..60c1fbebf 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -127,7 +127,9 @@ - + + $member !== null + diff --git a/tests/stub.phpstub b/tests/stub.phpstub index acc8d618a..981250adf 100644 --- a/tests/stub.phpstub +++ b/tests/stub.phpstub @@ -22,46 +22,61 @@ declare(strict_types=1); */ namespace OCA\Circles\Model { - class Member { - public const LEVEL_NONE = 0; - public const LEVEL_MEMBER = 1; - public const LEVEL_MODERATOR = 4; - public const LEVEL_ADMIN = 8; - public const LEVEL_OWNER = 9; + class Member { + public const LEVEL_NONE = 0; + public const LEVEL_MEMBER = 1; + public const LEVEL_MODERATOR = 4; + public const LEVEL_ADMIN = 8; + public const LEVEL_OWNER = 9; - public const TYPE_SINGLE = 0; - public const TYPE_USER = 1; - public const TYPE_GROUP = 2; - public const TYPE_MAIL = 4; - public const TYPE_CONTACT = 8; - public const TYPE_CIRCLE = 16; - public const TYPE_APP = 10000; + public const TYPE_SINGLE = 0; + public const TYPE_USER = 1; + public const TYPE_GROUP = 2; + public const TYPE_MAIL = 4; + public const TYPE_CONTACT = 8; + public const TYPE_CIRCLE = 16; + public const TYPE_APP = 10000; - public const ALLOWING_ALL_TYPES = 31; + public const ALLOWING_ALL_TYPES = 31; - public const APP_CIRCLES = 10001; - public const APP_OCC = 10002; - public const APP_DEFAULT = 11000; - } + public const APP_CIRCLES = 10001; + public const APP_OCC = 10002; + public const APP_DEFAULT = 11000; - class Circle { - public function getUniqueId(): string {} - public function getDisplayName(): string {} - public function getOwner(): string {} - public function getSingleId(): string {} - public function getInheritedMembers(): array {} - } + public function getLevel(): int {} + } + + class Circle { + public function getUniqueId(): string {} + public function getDisplayName(): string {} + public function getOwner(): string {} + public function getSingleId(): string {} + public function getInheritedMembers(): array {} + public function getInitiator(): Member {} + } + + class FederatedUser { + } } namespace OCA\Circles\Model\Probes { - class CircleProble { - public function __construct() {} - } + class CircleProbe { + public function __construct() {} + public function mustBeMember(bool $must = true): self {} + } } namespace OCA\Circles { - class CirclesManager { - } + use OCA\Circles\Model\Circle; + use OCA\Circles\Model\FederatedUser; + use OCA\Circles\Model\Probes\CircleProbe; + class CirclesManager { + public function startSuperSession(): void {} + public function startSession(?FederatedUser $federatedUser = null): void {} + public function getCircles(?CircleProbe $probe = null): array {} + public function getCircle(string $singleId, ?CircleProbe $probe = null): Circle {} + public function getFederatedUser(string $federatedId, int $type = Member::TYPE_SINGLE): FederatedUser {} + } } namespace { @@ -328,10 +343,10 @@ namespace OC\Files\Mount { protected $class; protected $storageId; protected $rootId = null; - + /** @var int|null */ protected $mountId; - + /** * @param string|\OCP\Files\Storage\IStorage $storage * @param string $mountpoint @@ -344,7 +359,7 @@ namespace OC\Files\Mount { public function __construct($storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null, $mountId = null) { throw new \Exception('stub'); } - + /** * get complete path to the mount point, relative to data/ * @@ -353,7 +368,7 @@ namespace OC\Files\Mount { public function getMountPoint() { throw new \Exception('stub'); } - + /** * Sets the mount point path, relative to data/ * @@ -362,28 +377,28 @@ namespace OC\Files\Mount { public function setMountPoint($mountPoint) { throw new \Exception('stub'); } - + /** * @return \OCP\Files\Storage\IStorage */ public function getStorage() { throw new \Exception('stub'); } - + /** * @return string */ public function getStorageId() { throw new \Exception('stub'); } - + /** * @return int */ public function getNumericStorageId() { throw new \Exception('stub'); } - + /** * @param string $path * @return string @@ -391,14 +406,14 @@ namespace OC\Files\Mount { public function getInternalPath($path) { throw new \Exception('stub'); } - + /** * @param callable $wrapper */ public function wrapStorage($wrapper) { throw new \Exception('stub'); } - + /** * Get a mount option * @@ -409,7 +424,7 @@ namespace OC\Files\Mount { public function getOption($name, $default) { throw new \Exception('stub'); } - + /** * Get all options for the mount * @@ -418,18 +433,18 @@ namespace OC\Files\Mount { public function getOptions() { throw new \Exception('stub'); } - + /** * @return int */ public function getStorageRootId() { throw new \Exception('stub'); } - + public function getMountId() { throw new \Exception('stub'); } - + public function getMountType() { throw new \Exception('stub'); }