diff --git a/src/Connection.php b/src/Connection.php index 5567cf8..da4e052 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -384,12 +384,12 @@ public function yieldPairs(Select|string $stmt, ?array $values = null): Generato /** * Prepare and execute the given statement * - * @param Delete|Insert|Select|Update|string $stmt The SQL statement to prepare and execute - * @param string|array $values Values to bind to the statement, if any + * @param Delete|Insert|Select|Update|string $stmt The SQL statement to prepare and execute + * @param string|array|null $values Values to bind to the statement, if any * * @return PDOStatement */ - public function prepexec($stmt, $values = null) + public function prepexec(Delete|Insert|Select|Update|string $stmt, string|array|null $values = null): PDOStatement { if ($values !== null && ! is_array($values)) { $values = [$values]; diff --git a/src/Test/TestConnection.php b/src/Test/TestConnection.php index 1e149b8..30e7cba 100644 --- a/src/Test/TestConnection.php +++ b/src/Test/TestConnection.php @@ -3,6 +3,11 @@ namespace ipl\Sql\Test; use ipl\Sql\Connection; +use ipl\Sql\Delete; +use ipl\Sql\Insert; +use ipl\Sql\Select; +use ipl\Sql\Update; +use PDOStatement; /** * Config-less test connection @@ -34,7 +39,7 @@ public function rollbackTransaction(): bool throw new \LogicException('Transactions are not supported by the test connection'); } - public function prepexec($stmt, $values = null) + public function prepexec(Delete|Insert|Select|Update|string $stmt, string|array|null $values = null): PDOStatement { if (PHP_MAJOR_VERSION >= 8) { return new class extends \PDOStatement {