Skip to content

Commit 57514e4

Browse files
committed
Psalm fixing
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 0262cc3 commit 57514e4

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
lines changed

apps/user_ldap/lib/Access.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ private function detectUuidAttribute($dn, $isUser = true, $force = false, array
17531753
}
17541754

17551755
$attribute = $this->connection->getFromCache($uuidAttr);
1756-
if (!$attribute === null) {
1756+
if ($attribute !== null) {
17571757
$this->connection->$uuidAttr = $attribute;
17581758
return true;
17591759
}

apps/user_status/lib/Db/UserStatusMapper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
*
3636
* @package OCA\UserStatus\Db
3737
*
38+
* @psalm-suppress MoreSpecificImplementedParamType
39+
*
3840
* @method UserStatus insert(UserStatus $entity)
3941
* @method UserStatus update(UserStatus $entity)
4042
* @method UserStatus insertOrUpdate(UserStatus $entity)

build/files-checker.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
'.jshintrc',
3939
'.mailmap',
4040
'.npmignore',
41-
'.php_cs.dist',
41+
'.php-cs-fixer.dist.php',
4242
'.scrutinizer.yml',
4343
'.tag',
4444
'.tx',
@@ -85,6 +85,7 @@
8585
'tests',
8686
'themes',
8787
'version.php',
88+
'vendor-bin',
8889
'webpack.common.js',
8990
'webpack.dev.js',
9091
'webpack.prod.js',

build/psalm-baseline.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,14 +2466,6 @@
24662466
<code>registerProvider</code>
24672467
</UndefinedInterfaceMethod>
24682468
</file>
2469-
<file src="apps/user_status/lib/Db/UserStatusMapper.php">
2470-
<MoreSpecificImplementedParamType occurrences="4">
2471-
<code>UserStatus insert(UserStatus $entity)</code>
2472-
<code>UserStatus insert(UserStatus $entity)</code>
2473-
<code>UserStatus insert(UserStatus $entity)</code>
2474-
<code>UserStatus insert(UserStatus $entity)</code>
2475-
</MoreSpecificImplementedParamType>
2476-
</file>
24772469
<file src="apps/workflowengine/lib/AppInfo/Application.php">
24782470
<InvalidArgument occurrences="1">
24792471
<code>registerEventListener</code>

lib/private/Collaboration/Resources/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function getCollectionForUser(int $id, ?IUser $user): ICollection {
131131
*/
132132
public function searchCollections(IUser $user, string $filter, int $limit = 50, int $start = 0): array {
133133
$query = $this->connection->getQueryBuilder();
134-
$userId = $user instanceof IUser ? $user->getUID() : '';
134+
$userId = $user->getUID();
135135

136136
$query->select('c.*', 'a.access')
137137
->from(self::TABLE_COLLECTIONS, 'c')

lib/private/Notification/Manager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,12 @@ public function prepare(INotification $notification, string $languageCode): INot
338338
throw new \InvalidArgumentException('The given notification has been processed');
339339
}
340340

341-
if (!($notification instanceof INotification) || !$notification->isValidParsed()) {
341+
if (!$notification->isValidParsed()) {
342342
throw new \InvalidArgumentException('The given notification has not been handled');
343343
}
344344
}
345345

346-
if (!($notification instanceof INotification) || !$notification->isValidParsed()) {
346+
if (!$notification->isValidParsed()) {
347347
throw new \InvalidArgumentException('The given notification has not been handled');
348348
}
349349

lib/private/legacy/OC_Util.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ public static function checkServer(\OC\SystemConfig $config) {
848848
'default_charset' => 'UTF-8',
849849
],
850850
];
851+
/** @var array<array-key, bool|string|int> $missingDependencies */
851852
$missingDependencies = [];
852853
$invalidIniSettings = [];
853854

@@ -894,7 +895,7 @@ public static function checkServer(\OC\SystemConfig $config) {
894895
}
895896
foreach ($invalidIniSettings as $setting) {
896897
if (is_bool($setting[1])) {
897-
$setting[1] = $setting[1] ? 'on' : 'off';
898+
$setting[1] = $setting[1] === true ? 'on' : 'off';
898899
}
899900
$errors[] = [
900901
'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]),

0 commit comments

Comments
 (0)