eee
This commit is contained in:
+8
-8
@@ -77,8 +77,8 @@ class Command extends Component
|
||||
*/
|
||||
public function all(): bool|array
|
||||
{
|
||||
$client = $this->connection->getConnection();
|
||||
try {
|
||||
$client = $this->connection->getConnection();
|
||||
if (($prepare = $client->prepare($this->sql)) === false) {
|
||||
throw new Exception($client->errorInfo()[1]);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ class Command extends Component
|
||||
}
|
||||
return $this->error($throwable);
|
||||
} finally {
|
||||
$this->connection->release($client);
|
||||
$this->connection->release($client ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,8 +100,8 @@ class Command extends Component
|
||||
*/
|
||||
public function one(): null|bool|array
|
||||
{
|
||||
$client = $this->connection->getConnection();
|
||||
try {
|
||||
$client = $this->connection->getConnection();
|
||||
if (($prepare = $client->prepare($this->sql)) === false) {
|
||||
throw new Exception($client->errorInfo()[1]);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ class Command extends Component
|
||||
}
|
||||
return $this->error($throwable);
|
||||
} finally {
|
||||
$this->connection->release($client);
|
||||
$this->connection->release($client ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,8 +123,8 @@ class Command extends Component
|
||||
*/
|
||||
public function fetchColumn(): mixed
|
||||
{
|
||||
$client = $this->connection->getConnection();
|
||||
try {
|
||||
$client = $this->connection->getConnection();
|
||||
if (($prepare = $client->prepare($this->sql)) === false) {
|
||||
throw new Exception($client->errorInfo()[1]);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class Command extends Component
|
||||
}
|
||||
return $this->error($throwable);
|
||||
} finally {
|
||||
$this->connection->release($client);
|
||||
$this->connection->release($client ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,8 +158,8 @@ class Command extends Component
|
||||
*/
|
||||
private function _execute(): bool|int
|
||||
{
|
||||
$client = $this->connection->getConnection();
|
||||
try {
|
||||
$client = $this->connection->getConnection();
|
||||
if (($prepare = $client->prepare($this->sql)) === false) {
|
||||
throw new Exception($client->errorInfo()[1]);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ class Command extends Component
|
||||
}
|
||||
return $this->error($throwable);
|
||||
} finally {
|
||||
$this->connection->release($client);
|
||||
$this->connection->release($client ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user