From 43c8dab5c21942ec7fccb6e669bb769970082bfe Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Fri, 22 May 2020 18:26:54 -0500 Subject: [PATCH] Move sql argument --- src/PgSqlHandle.php | 4 ++-- src/PqHandle.php | 2 +- src/QueryExecutionError.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PgSqlHandle.php b/src/PgSqlHandle.php index b571bd2..ba5278d 100644 --- a/src/PgSqlHandle.php +++ b/src/PgSqlHandle.php @@ -268,7 +268,7 @@ final class PgSqlHandle implements Handle foreach (self::DIAGNOSTIC_CODES as $fieldCode => $description) { $diagnostics[$description] = \pg_result_error_field($result, $fieldCode); } - throw new QueryExecutionError(\pg_result_error($result), $diagnostics, null, $sql); + throw new QueryExecutionError(\pg_result_error($result), $diagnostics, $sql); case \PGSQL_BAD_RESPONSE: throw new FailureException(\pg_result_error($result)); @@ -419,7 +419,7 @@ final class PgSqlHandle implements Handle foreach (self::DIAGNOSTIC_CODES as $fieldCode => $description) { $diagnostics[$description] = \pg_result_error_field($result, $fieldCode); } - throw new QueryExecutionError(\pg_result_error($result), $diagnostics, null, $sql); + throw new QueryExecutionError(\pg_result_error($result), $diagnostics, $sql); case \PGSQL_BAD_RESPONSE: throw new FailureException(\pg_result_error($result)); diff --git a/src/PqHandle.php b/src/PqHandle.php index 370c81c..cbebcaf 100644 --- a/src/PqHandle.php +++ b/src/PqHandle.php @@ -240,7 +240,7 @@ final class PqHandle implements Handle case pq\Result::NONFATAL_ERROR: case pq\Result::FATAL_ERROR: - throw new QueryExecutionError($result->errorMessage, $result->diag, null, $sql ?? ''); + throw new QueryExecutionError($result->errorMessage, $result->diag, $sql ?? ''); case pq\Result::BAD_RESPONSE: throw new FailureException($result->errorMessage); diff --git a/src/QueryExecutionError.php b/src/QueryExecutionError.php index 9627844..1f8633b 100644 --- a/src/QueryExecutionError.php +++ b/src/QueryExecutionError.php @@ -9,7 +9,7 @@ class QueryExecutionError extends QueryError /** @var mixed[] */ private $diagnostics; - public function __construct(string $message, array $diagnostics, \Throwable $previous = null, string $query = '') + public function __construct(string $message, array $diagnostics, string $query = '', \Throwable $previous = null) { parent::__construct($message, $query, $previous); $this->diagnostics = $diagnostics;