diff --git a/phpstan-baseline.neon.dist b/phpstan-baseline.neon.dist index 709ab6c6a5bb..a3bc07fd877b 100644 --- a/phpstan-baseline.neon.dist +++ b/phpstan-baseline.neon.dist @@ -65,11 +65,6 @@ parameters: count: 3 path: system/Database/MySQLi/PreparedQuery.php - - - message: "#^Strict comparison using \\=\\=\\= between array and false will always evaluate to false\\.$#" - count: 1 - path: system/Database/Postgre/Connection.php - - message: "#^Access to an undefined property CodeIgniter\\\\Database\\\\BaseConnection\\:\\:\\$schema\\.$#" count: 2 diff --git a/system/Database/Postgre/Connection.php b/system/Database/Postgre/Connection.php index d5074d0ce595..bb790e48292c 100644 --- a/system/Database/Postgre/Connection.php +++ b/system/Database/Postgre/Connection.php @@ -128,11 +128,14 @@ public function getVersion(): string return $this->dataCache['version']; } - if (! $this->connID || ($pgVersion = pg_version($this->connID)) === false) { + if (! $this->connID) { $this->initialize(); } - return isset($pgVersion['server']) ? $this->dataCache['version'] = $pgVersion['server'] : false; + $pgVersion = pg_version($this->connID); + $this->dataCache['version'] = $pgVersion['server'] ?? ''; + + return $this->dataCache['version']; } /**