Skip to content

Commit

Permalink
enable checkImplicitMixed
Browse files Browse the repository at this point in the history
  • Loading branch information
schlndh committed Apr 19, 2024
1 parent 776090d commit 462a845
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ parameters:
- src
- tests
treatPhpDocTypesAsCertain: false
# TODO: enable this
# checkImplicitMixed: true
checkImplicitMixed: true
excludePaths:
- tests/*/data/*
exceptions:
Expand Down
8 changes: 7 additions & 1 deletion tests/Analyser/AnalyserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@ public function testValid(string $query, array $params = [], array $explicitFiel
}

foreach ($rows as $row) {
$this->assertIsArray($row);
$this->assertSame($fieldKeys, array_keys($row));

foreach ($forceNullsForColumns as $col => $mustBeNull) {
Expand All @@ -1392,6 +1393,7 @@ public function testValid(string $query, array $params = [], array $explicitFiel
}

$parsedDateTime = false;
$this->assertIsString($val);

foreach (['Y-m-d H:i:s', 'Y-m-d'] as $format) {
$parsedDateTime = $parsedDateTime ?: DateTimeImmutable::createFromFormat($format, $val);
Expand Down Expand Up @@ -1875,9 +1877,13 @@ public function testValidNullability(string $query, array $params = []): void
$rowCount,
'Nullability test query has to return at least 1 row, but it did not return any.',
);
$nullCountsByColumn = array_fill_keys(array_keys($rows[0]), 0);
$firstRow = $rows[0];
$this->assertIsArray($firstRow);
$nullCountsByColumn = array_fill_keys(array_keys($firstRow), 0);

foreach ($rows as $row) {
$this->assertIsArray($row);

foreach ($row as $col => $value) {
if ($value !== null) {
continue;
Expand Down

0 comments on commit 462a845

Please sign in to comment.