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
2 changes: 1 addition & 1 deletion .phpstan-dba-mysqli.cache

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

2 changes: 1 addition & 1 deletion .phpstan-dba-pdo-mysql.cache

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

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"tests/defaultFetchAssoc/data/",
"tests/defaultFetchNumeric/data/",
"tests/rules/data/",
"tests/stringify/data/"
"tests/stringify/data/",
"tests/sqlAst/data"
]
},
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ parameters:
count: 1
path: src/QueryReflection/DbaApi.php

-
message: '#^Cannot access offset int\<0, max\> on array\<array\{name\: string, table\: string, native_type\: string, len\: int, flags\: array\<int, string\>, precision\: int\<0, max\>, pdo_type\: 0\|1\|2\|3\|4\|5\|6\|536870912\|1073741824\|2147483648\}\>\|PDOException\|null\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/QueryReflection/PdoMysqlQueryReflector.php

-
message: '''
#^Call to deprecated method resolvePreparedQueryString\(\) of class staabm\\PHPStanDba\\QueryReflection\\QueryReflection\:
Expand Down
2 changes: 1 addition & 1 deletion tests/default/data/pdo-mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function aggregateFunctions(PDO $pdo)
$query = 'SELECT MAX(adaid), MIN(adaid), COUNT(adaid), AVG(adaid) FROM ada WHERE adaid = 1';
$stmt = $pdo->query($query, PDO::FETCH_ASSOC);
foreach ($stmt as $row) {
assertType('array{MAX(adaid): int<-32768, 32767>|null, MIN(adaid): int<-32768, 32767>|null, COUNT(adaid): int, AVG(adaid): numeric-string|null}', $row);
assertType("array{'MAX(adaid)': int<-32768, 32767>|null, 'MIN(adaid)': int<-32768, 32767>|null, 'COUNT(adaid)': int, 'AVG(adaid)': numeric-string|null}", $row);
}
}

Expand Down
30 changes: 15 additions & 15 deletions tests/sqlAst/config/.phpunit-phpstan-dba-mysqli.cache

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

30 changes: 15 additions & 15 deletions tests/sqlAst/config/.phpunit-phpstan-dba-pdo-mysql.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/sqlAst/data/sql-ast-narrowing.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function count(PDO $pdo): void

$stmt = $pdo->query('SELECT count(email) as myemail, count(email) from ada');
foreach ($stmt as $row) {
assertType('array{myemail: int<0, max>, 0: int<0, max>, count(email): int<0, max>, 1: int<0, max>}', $row);
assertType("array{myemail: int<0, max>, 0: int<0, max>, 'count(email)': int<0, max>, 1: int<0, max>}", $row);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/stringify/data/ast-narrowed-stringify.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function count(PDO $pdo): void

$stmt = $pdo->query('SELECT count(email) as myemail, count(email) from ada');
foreach ($stmt as $row) {
assertType("array{myemail: numeric-string, 0: numeric-string, count(email): numeric-string, 1: numeric-string}", $row);
assertType("array{myemail: numeric-string, 0: numeric-string, 'count(email)': numeric-string, 1: numeric-string}", $row);
}
}
}