Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private function inferType(MethodReflection $methodReflection, MethodCall $metho
if (QueryReflector::FETCH_TYPE_KEY_VALUE === $fetchType) {
return $rowType;
}

return new ArrayType(new IntegerType(), $rowType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testSyntaxErrorInQueryRule(): void
36,
],
[
"Query error: Table 'phpstan_dba.unknownTable' doesn't exist (1146).",
"Query error: Table 'phpstan_dba.unknown_table' doesn't exist (1146).",
41,
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testSyntaxErrorInQueryRule(): void
36,
],
[
"Query error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'phpstan_dba.unknownTable' doesn't exist (42S02).",
"Query error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'phpstan_dba.unknown_table' doesn't exist (42S02).",
41,
],
[
Expand Down
9 changes: 8 additions & 1 deletion tests/rules/config/.phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion tests/rules/config/.phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions tests/rules/config/.phpunit-phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions tests/rules/config/.phpunit-phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/rules/data/syntax-error-in-query-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function unknownGroupByColumn(PDO $pdo)

public function unknownTable(PDO $pdo)
{
$pdo->query('SELECT * FROM unknownTable', PDO::FETCH_ASSOC);
$pdo->query('SELECT * FROM unknown_table', PDO::FETCH_ASSOC);
}

public function incompleteQuery(PDO $pdo, string $tableName)
Expand Down