Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,12 @@
/**
* 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 {

Check failure on line 390 in src/Connection.php

View workflow job for this annotation

GitHub Actions / PHP / Lint (8.2) / Linters 8.2

Opening brace should be on a new line

Check failure on line 390 in src/Connection.php

View workflow job for this annotation

GitHub Actions / PHP / Lint (8.5) / Linters 8.5

Opening brace should be on a new line

Check failure on line 390 in src/Connection.php

View workflow job for this annotation

GitHub Actions / PHP / Lint (8.4) / Linters 8.4

Opening brace should be on a new line

Check failure on line 390 in src/Connection.php

View workflow job for this annotation

GitHub Actions / PHP / Lint (8.3) / Linters 8.3

Opening brace should be on a new line
if ($values !== null && ! is_array($values)) {
$values = [$values];
}
Expand Down
8 changes: 6 additions & 2 deletions src/Test/TestConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -34,8 +39,7 @@
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 {

Check failure on line 42 in src/Test/TestConnection.php

View workflow job for this annotation

GitHub Actions / PHP / Lint (8.2) / Linters 8.2

Opening brace should be on a new line

Check failure on line 42 in src/Test/TestConnection.php

View workflow job for this annotation

GitHub Actions / PHP / Lint (8.5) / Linters 8.5

Opening brace should be on a new line

Check failure on line 42 in src/Test/TestConnection.php

View workflow job for this annotation

GitHub Actions / PHP / Lint (8.4) / Linters 8.4

Opening brace should be on a new line

Check failure on line 42 in src/Test/TestConnection.php

View workflow job for this annotation

GitHub Actions / PHP / Lint (8.3) / Linters 8.3

Opening brace should be on a new line
if (PHP_MAJOR_VERSION >= 8) {
return new class extends \PDOStatement {
public function getIterator(): \Iterator
Expand Down
Loading