Skip to content

Commit

Permalink
Fix static analysis errors and add a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosp committed Feb 15, 2023
1 parent 70fab43 commit a40e4a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Log/LoggingStatement.php
Expand Up @@ -20,7 +20,6 @@
use Cake\Database\Exception\DatabaseException;
use Cake\Database\Statement\StatementDecorator;
use Exception;
use PDOException;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -82,10 +81,15 @@ public function execute(?array $params = null): bool
$this->_log();

if (Configure::read('Error.wrapStatementException', false) === true) {
$code = $e->getCode();
if (!is_int($code)) {
$code = null;
}

throw new DatabaseException([
'message' => $e->getMessage(),
'queryString' => $this->queryString,
], $e->getCode(), $e);
], $code, $e);
}

if (version_compare(PHP_VERSION, '8.2.0', '<')) {
Expand Down

0 comments on commit a40e4a5

Please sign in to comment.