diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-03 21:55:57 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-04 19:57:00 +0200 |
commit | 35d5395089e17e2402e4786c25f0ba915b924773 (patch) | |
tree | 5b3345ca6e725955cab09fbd61095e4fbb6b86ab | |
parent | 8ec640d14ac6dec7c6f52ac8bca997615931478b (diff) | |
download | nextcloud-server-35d5395089e17e2402e4786c25f0ba915b924773.tar.gz nextcloud-server-35d5395089e17e2402e4786c25f0ba915b924773.zip |
psalm happiness
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
psalm happiness
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | build/psalm-baseline.xml | 3 | ||||
-rw-r--r-- | lib/private/Accounts/Account.php | 2 | ||||
-rw-r--r-- | lib/private/Accounts/AccountManager.php | 2 |
3 files changed, 2 insertions, 5 deletions
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index fc6c553d0c0..e95c067701f 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1769,9 +1769,6 @@ </TooManyArguments> </file> <file src="apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php"> - <InvalidArrayOffset occurrences="1"> - <code>$publicData[IAccountManager::PROPERTY_DISPLAYNAME]['value']</code> - </InvalidArrayOffset> <InvalidScalarArgument occurrences="1"> <code>$this->retries + 1</code> </InvalidScalarArgument> diff --git a/lib/private/Accounts/Account.php b/lib/private/Accounts/Account.php index 5f063d5dc5f..8fe2255e030 100644 --- a/lib/private/Accounts/Account.php +++ b/lib/private/Accounts/Account.php @@ -59,7 +59,7 @@ class Account implements IAccount { if ($this->isCollection($property)) { throw new \InvalidArgumentException('getProperty cannot retrieve an IAccountsPropertyCollection'); } - if (!array_key_exists($property, $this->properties)) { + if (!array_key_exists($property, $this->properties) || !$this->properties[$property] instanceof IAccountProperty) { throw new PropertyDoesNotExistException($property); } return $this->properties[$property]; diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 801250004fb..4d7aae644bb 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -142,7 +142,7 @@ class AccountManager implements IAccountManager { } protected function sanitizeLength(array &$propertyData, bool $throwOnData = false): void { - if (isset($propertyData) && isset($propertyData['value']) && strlen($propertyData['value']) > 2048) { + if (isset($propertyData['value']) && strlen($propertyData['value']) > 2048) { if ($throwOnData) { throw new \InvalidArgumentException(); } else { |