From f8d9cb157ba9f0cac760940faf786470e080ff23 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 12 Sep 2024 09:52:42 +0200 Subject: [PATCH] Fix new phpstan errors --- phpstan.neon.dist | 3 --- program/lib/Roundcube/cache/redis.php | 4 +--- program/lib/Roundcube/session/redis.php | 4 +--- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index df1f28db05d..fee816962a1 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -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\.$~' diff --git a/program/lib/Roundcube/cache/redis.php b/program/lib/Roundcube/cache/redis.php index 2b04344708e..385d4ce44b7 100644 --- a/program/lib/Roundcube/cache/redis.php +++ b/program/lib/Roundcube/cache/redis.php @@ -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; diff --git a/program/lib/Roundcube/session/redis.php b/program/lib/Roundcube/session/redis.php index d8a6385cff2..d92b9557001 100644 --- a/program/lib/Roundcube/session/redis.php +++ b/program/lib/Roundcube/session/redis.php @@ -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); }