Skip to content

Commit

Permalink
Connection: Fix argument & variable type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 13, 2023
1 parent 01d70f0 commit 0f19cc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
20 changes: 0 additions & 20 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ parameters:
count: 1
path: src/Connection.php

-
message: "#^Method ipl\\\\Sql\\\\Connection\\:\\:__construct\\(\\) has parameter \\$config with no value type specified in iterable type iterable\\.$#"
count: 1
path: src/Connection.php

-
message: "#^Method ipl\\\\Sql\\\\Connection\\:\\:delete\\(\\) has parameter \\$table with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -215,11 +210,6 @@ parameters:
count: 1
path: src/Connection.php

-
message: "#^Method ipl\\\\Sql\\\\Connection\\:\\:prepexec\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#"
count: 1
path: src/Connection.php

-
message: "#^Method ipl\\\\Sql\\\\Connection\\:\\:update\\(\\) has parameter \\$data with no value type specified in iterable type iterable\\.$#"
count: 1
Expand Down Expand Up @@ -270,16 +260,6 @@ parameters:
count: 1
path: src/Connection.php

-
message: "#^Parameter \\#2 \\$values of method ipl\\\\Sql\\\\Connection\\:\\:prepexec\\(\\) expects array\\|string\\|null, mixed given\\.$#"
count: 1
path: src/Connection.php

-
message: "#^Parameter \\#2 \\$values of method ipl\\\\Sql\\\\Connection\\:\\:yieldPairs\\(\\) expects array\\|null, mixed given\\.$#"
count: 1
path: src/Connection.php

-
message: "#^Property ipl\\\\Sql\\\\Connection\\:\\:\\$adapter \\(ipl\\\\Sql\\\\Contract\\\\Adapter\\) does not accept object\\.$#"
count: 1
Expand Down
5 changes: 3 additions & 2 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Connection implements Quoter
*
* {@link init()} is called after construction.
*
* @param Config|iterable $config
* @param Config|iterable<string, mixed> $config
*
* @throws InvalidArgumentException If there's no adapter for the given database available
*/
Expand Down Expand Up @@ -302,6 +302,7 @@ public function yieldAll($stmt, ...$args)

if (! empty($args)) {
if (is_array($args[0])) {
/** @var array<int, mixed> $values */
$values = array_shift($args);
}
}
Expand Down Expand Up @@ -382,7 +383,7 @@ public function yieldPairs($stmt, array $values = null)
* 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 null|string|array<int, mixed> $values Values to bind to the statement, if any
*
* @return PDOStatement
*/
Expand Down

0 comments on commit 0f19cc1

Please sign in to comment.