diff --git a/phpstan/config.neon b/phpstan/config.neon index 6ffdbe68e..6790168b9 100644 --- a/phpstan/config.neon +++ b/phpstan/config.neon @@ -21,6 +21,7 @@ parameters: reportUnmatchedIgnoredErrors: false treatPhpDocTypesAsCertain: false + reportPossiblyNonexistentConstantArrayOffset: true ignoreErrors: # unused parameters diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index b7ee15681..1b6f5e7b8 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -402,6 +402,8 @@ EOT /** * @param array $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 diff --git a/tests/Composer/Test/Command/LicensesCommandTest.php b/tests/Composer/Test/Command/LicensesCommandTest.php index b48e625f3..fa92d5496 100644 --- a/tests/Composer/Test/Command/LicensesCommandTest.php +++ b/tests/Composer/Test/Command/LicensesCommandTest.php @@ -78,6 +78,9 @@ class LicensesCommandTest extends TestCase continue; } + if (!isset($expected[$i])) { + $this->fail('Got more output lines than expected'); + } $this->assertMatchesRegularExpression("/" . implode("\s+", $expected[$i]) . "/", $line); } } @@ -108,6 +111,9 @@ class LicensesCommandTest extends TestCase continue; } + if (!isset($expected[$i])) { + $this->fail('Got more output lines than expected'); + } $this->assertMatchesRegularExpression("/" . implode("\s+", $expected[$i]) . "/", $line); } }