Skip to content

Commit

Permalink
fixup! Fix PostgreSQL getVersion() logic
Browse files Browse the repository at this point in the history
  • Loading branch information
marekmosna committed May 12, 2023
1 parent 8064aab commit 98362e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ parameters:
count: 3
path: system/Database/MySQLi/PreparedQuery.php

-
message: "#^Strict comparison using \\=\\=\\= between array<string, int|string|null> 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
Expand Down
6 changes: 5 additions & 1 deletion system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ public function getVersion(): string

$pgVersion = pg_version($this->connID);

return isset($pgVersion['server']) ? $this->dataCache['version'] = $pgVersion['server'] : false;
if (! isset($pgVersion['server'])) {
return 'PostgreSQL 7.4 or lower';
}

return $this->dataCache['version'] = $pgVersion['server'];
}

/**
Expand Down

0 comments on commit 98362e6

Please sign in to comment.