]> source.dussan.org Git - nextcloud-server.git/commitdiff
Psalm fixing 30826/head
authorCarl Schwan <carl@carlschwan.eu>
Wed, 26 Jan 2022 11:11:33 +0000 (12:11 +0100)
committerCarl Schwan <carl@carlschwan.eu>
Thu, 27 Jan 2022 16:20:48 +0000 (17:20 +0100)
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
apps/user_ldap/lib/Access.php
apps/user_status/lib/Db/UserStatusMapper.php
build/files-checker.php
build/psalm-baseline.xml
lib/private/Collaboration/Resources/Manager.php
lib/private/Notification/Manager.php
lib/private/legacy/OC_Util.php

index 91b11cb51f5dd8ff5775242a3c92f732a134dc94..852a271f5b7c2f7048483d7ef46fd13a4550f66e 100644 (file)
@@ -1753,7 +1753,7 @@ class Access extends LDAPUtility {
                        }
 
                        $attribute = $this->connection->getFromCache($uuidAttr);
-                       if (!$attribute === null) {
+                       if ($attribute !== null) {
                                $this->connection->$uuidAttr = $attribute;
                                return true;
                        }
index b61ee27c77d5722414b5d35e3d80e2c8a9c0411f..92fd66134def3e6fb0ea264208da151f2773d3b8 100644 (file)
@@ -35,6 +35,8 @@ use OCP\UserStatus\IUserStatus;
  *
  * @package OCA\UserStatus\Db
  *
+ * @psalm-suppress MoreSpecificImplementedParamType
+ *
  * @method UserStatus insert(UserStatus $entity)
  * @method UserStatus update(UserStatus $entity)
  * @method UserStatus insertOrUpdate(UserStatus $entity)
index 88006e15a63431c273229ebe2d71e71014453a9b..d2f04ad43f848c4b6fec3f3ccb6a21a7aa25c48f 100644 (file)
@@ -38,7 +38,7 @@ $expectedFiles = [
        '.jshintrc',
        '.mailmap',
        '.npmignore',
-       '.php_cs.dist',
+       '.php-cs-fixer.dist.php',
        '.scrutinizer.yml',
        '.tag',
        '.tx',
@@ -85,6 +85,7 @@ $expectedFiles = [
        'tests',
        'themes',
        'version.php',
+       'vendor-bin',
        'webpack.common.js',
        'webpack.dev.js',
        'webpack.prod.js',
index 12f7dec3a856adfd08f30878042a5ccc5ce08d0d..3944384f59cfed4d6a9334a2927ae691127782a1 100644 (file)
       <code>registerProvider</code>
     </UndefinedInterfaceMethod>
   </file>
-  <file src="apps/user_status/lib/Db/UserStatusMapper.php">
-    <MoreSpecificImplementedParamType occurrences="4">
-      <code>UserStatus insert(UserStatus $entity)</code>
-      <code>UserStatus insert(UserStatus $entity)</code>
-      <code>UserStatus insert(UserStatus $entity)</code>
-      <code>UserStatus insert(UserStatus $entity)</code>
-    </MoreSpecificImplementedParamType>
-  </file>
   <file src="apps/workflowengine/lib/AppInfo/Application.php">
     <InvalidArgument occurrences="1">
       <code>registerEventListener</code>
index a0fba16998fb2827499a3d14144b53bd572d637a..8fc3d0dd5eae506700078875f98da8ae5335c4aa 100644 (file)
@@ -131,7 +131,7 @@ class Manager implements IManager {
         */
        public function searchCollections(IUser $user, string $filter, int $limit = 50, int $start = 0): array {
                $query = $this->connection->getQueryBuilder();
-               $userId = $user instanceof IUser ? $user->getUID() : '';
+               $userId = $user->getUID();
 
                $query->select('c.*', 'a.access')
                        ->from(self::TABLE_COLLECTIONS, 'c')
index fb3a46d5f5d021f45768af2ac417b7e6cf94824c..4fa5736c206cea44dfc4c32fb58accc5718bd2b8 100644 (file)
@@ -338,12 +338,12 @@ class Manager implements IManager {
                                throw new \InvalidArgumentException('The given notification has been processed');
                        }
 
-                       if (!($notification instanceof INotification) || !$notification->isValidParsed()) {
+                       if (!$notification->isValidParsed()) {
                                throw new \InvalidArgumentException('The given notification has not been handled');
                        }
                }
 
-               if (!($notification instanceof INotification) || !$notification->isValidParsed()) {
+               if (!$notification->isValidParsed()) {
                        throw new \InvalidArgumentException('The given notification has not been handled');
                }
 
index d351b0daa76286d9eac236e5a93e75d73054a594..e63b7165fabdaf96faf9c508160140e9b71e6783 100644 (file)
@@ -848,6 +848,7 @@ class OC_Util {
                                'default_charset' => 'UTF-8',
                        ],
                ];
+               /** @var array<array-key, bool|string|int> $missingDependencies */
                $missingDependencies = [];
                $invalidIniSettings = [];
 
@@ -894,7 +895,7 @@ class OC_Util {
                }
                foreach ($invalidIniSettings as $setting) {
                        if (is_bool($setting[1])) {
-                               $setting[1] = $setting[1] ? 'on' : 'off';
+                               $setting[1] = $setting[1] === true ? 'on' : 'off';
                        }
                        $errors[] = [
                                'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]),