Skip to content

Commit

Permalink
Enable new phpstan option
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed May 27, 2024
1 parent 09e616f commit f83b6b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpstan/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ parameters:

reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false
reportPossiblyNonexistentConstantArrayOffset: true

ignoreErrors:
# unused parameters
Expand Down
2 changes: 2 additions & 0 deletions src/Composer/Command/RequireCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ private function getPackagesByRequireKey(): array

/**
* @param array<string, string> $requirements
* @param 'require'|'require-dev' $requireKey
* @param 'require'|'require-dev' $removeKey
* @throws \Exception
*/
private function doUpdate(InputInterface $input, OutputInterface $output, IOInterface $io, array $requirements, string $requireKey, string $removeKey): int
Expand Down
6 changes: 6 additions & 0 deletions tests/Composer/Test/Command/LicensesCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public function testBasicRun(): void
continue;
}

if (!isset($expected[$i])) {
$this->fail('Got more output lines than expected');
}
$this->assertMatchesRegularExpression("/" . implode("\s+", $expected[$i]) . "/", $line);
}
}
Expand Down Expand Up @@ -108,6 +111,9 @@ public function testNoDev(): void
continue;
}

if (!isset($expected[$i])) {
$this->fail('Got more output lines than expected');
}
$this->assertMatchesRegularExpression("/" . implode("\s+", $expected[$i]) . "/", $line);
}
}
Expand Down

0 comments on commit f83b6b1

Please sign in to comment.