diff options
author | dartcafe <github@dartcafe.de> | 2022-01-25 00:30:31 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2022-01-25 00:30:31 +0300 |
commit | f4d87bbc2d573bafcdf5246ef6304e54b4d2b6d0 (patch) | |
tree | 050bca3c57f0fdcf2ea995051362f77579463926 | |
parent | d64f9ce270ad2b7e5e0dae3f84a3ed5830309ee9 (diff) |
fixes and corrections
Signed-off-by: dartcafe <github@dartcafe.de>
-rw-r--r-- | lib/Db/Option.php | 2 | ||||
-rw-r--r-- | lib/Db/Poll.php | 10 | ||||
-rw-r--r-- | lib/Helper/Container.php | 2 | ||||
-rw-r--r-- | lib/Provider/ResourceProvider.php | 2 | ||||
-rw-r--r-- | psalm-baseline.xml | 6 |
5 files changed, 19 insertions, 3 deletions
diff --git a/lib/Db/Option.php b/lib/Db/Option.php index 930c6a89..1a1b3d1f 100644 --- a/lib/Db/Option.php +++ b/lib/Db/Option.php @@ -177,7 +177,7 @@ class Option extends Entity implements JsonSerializable { $this->setOwner($userId); } - // used for 1.9.0-beta1 installtions + // used for 1.9.0-beta1 installations public function getOwner() : string { if ($this->owner === 'disallow' || $this->owner === null) { return ''; diff --git a/lib/Db/Poll.php b/lib/Db/Poll.php index 3ba05f40..dd14a8d3 100644 --- a/lib/Db/Poll.php +++ b/lib/Db/Poll.php @@ -271,6 +271,16 @@ class Poll extends Entity implements JsonSerializable { return $this->getId(); } + // alias of getOwner() + public function getUserId() : string { + return $this->getOwner(); + } + + // alias of setOwner($value) + public function setUserId(string $userId) : void { + $this->setOwner($userId); + } + public function getProposalsExpired(): bool { return ( $this->getProposalsExpire() > 0 diff --git a/lib/Helper/Container.php b/lib/Helper/Container.php index 6ede5f1a..5edd624d 100644 --- a/lib/Helper/Container.php +++ b/lib/Helper/Container.php @@ -39,7 +39,7 @@ abstract class Container { } public static function queryClass(string $class) { - return self::getContainer()->query($class); + return self::getContainer()->get($class); } public static function queryPoll(int $pollId) : Poll { diff --git a/lib/Provider/ResourceProvider.php b/lib/Provider/ResourceProvider.php index 1f8177dd..042c3c98 100644 --- a/lib/Provider/ResourceProvider.php +++ b/lib/Provider/ResourceProvider.php @@ -93,7 +93,7 @@ class ResourceProvider implements IProvider { return true; } - public function invalidateAccessCache($pollId = null) { + public function invalidateAccessCache($pollId = null): void { if ($pollId !== null) { $resource = $this->resourceManager->getResourceForUser(self::RESOURCE_TYPE, (string)$pollId, null); $this->resourceManager->invalidateAccessCacheForResource($resource); diff --git a/psalm-baseline.xml b/psalm-baseline.xml index b3bc22f6..64355c64 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -28,6 +28,12 @@ <code>registerEventListener</code> </InvalidArgument> </file> + <file src="lib/Db/Preferences.php"> + <UndefinedClass occurrences="2"> + <code>BackgroundService</code> + <code>BackgroundService</code> + </UndefinedClass> + </file> <file src="lib/Listener/BaseListener.php"> <UndefinedMethod occurrences="10"> <code>getActivityId</code> |