Skip to content

Commit 1a113f6

Browse files
committed
refactor(Postgre): revert unneeded changes in Postgre Connection
1 parent a0c46da commit 1a113f6

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

‎system/Database/Postgre/Connection.php‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use PgSql\Result as PgSqlResult;
2323
use stdClass;
2424
use Stringable;
25-
use Throwable;
2625

2726
/**
2827
* Connection for Postgre
@@ -160,30 +159,15 @@ private function convertDSN()
160159

161160
protected function _close()
162161
{
163-
if ($this->connID !== false) {
164-
try {
165-
pg_close($this->connID);
166-
} catch (Throwable) {
167-
} finally {
168-
$this->connID = false;
169-
}
170-
}
162+
pg_close($this->connID);
171163
}
172164

173165
/**
174166
* Ping the database connection.
175167
*/
176168
protected function _ping(): bool
177169
{
178-
if ($this->connID === false) {
179-
return false;
180-
}
181-
182-
try {
183-
return pg_ping($this->connID);
184-
} catch (Throwable) {
185-
return false;
186-
}
170+
return pg_ping($this->connID);
187171
}
188172

189173
/**

0 commit comments

Comments
 (0)