Skip to content

Commit

Permalink
Fix new phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Sep 12, 2024
1 parent 83417f5 commit f8d9cb1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ parameters:
path: 'program/lib/Roundcube/rcube_imap_generic.php'
message: '~^(Instantiated class (GSSAPIContext|KRB5CCache) not found|Call to method \w+\(\) on an unknown class (GSSAPIContext|KRB5CCache))\.$~'
count: 7

# https://github.com/phpstan/phpstan/issues/10499
- '~^Function pam_chpass invoked with 3 parameters, 4-5 required\.$~'
4 changes: 1 addition & 3 deletions program/lib/Roundcube/cache/redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ protected function delete_item($key)

try {
// @phpstan-ignore-next-line
$result = method_exists(self::$redis, 'del')
? self::$redis->del($key)
: self::$redis->delete($key);
$result = method_exists(self::$redis, 'del') ? self::$redis->del($key) : self::$redis->delete($key);
} catch (Exception $e) {
rcube::raise_error($e, true, false);
return false;
Expand Down
4 changes: 1 addition & 3 deletions program/lib/Roundcube/session/redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ public function destroy($key)
if ($key) {
try {
// @phpstan-ignore-next-line
$result = method_exists($this->redis, 'del')
? $this->redis->del($key)
: $this->redis->delete($key);
$result = method_exists($this->redis, 'del') ? $this->redis->del($key) : $this->redis->delete($key);
} catch (Exception $e) {
rcube::raise_error($e, true, true);
}
Expand Down

0 comments on commit f8d9cb1

Please sign in to comment.