diff --git a/composer.json b/composer.json index 0b76857..d59a205 100644 --- a/composer.json +++ b/composer.json @@ -46,12 +46,20 @@ "scripts": { "test": [ "@phpunit", - "@phpstan-analise" + "@phpstan" ], "phive-install": "phive install --trust-gpg-keys $(cat .phive/trust-gpg-keys.txt)", "phpunit": "vendor/bin/phpunit", - "phpstan-analise": "vendor/bin/phpstan analyse", - "phpstan-update": "vendor/bin/phpstan analyse --generate-baseline phpstan-baseline.neon", + "phpstan": [ + "@phpstan-clear", + "@phpstan-analyse" + ], + "phpstan-analise": "vendor/bin/phpstan analyse -c scripts/phpstan/config.neon", + "phpstan-baseline": [ + "@phpstan-clear", + "@phpstan-analise --generate-baseline phpstan-baseline.neon" + ], + "phpstan-clear": "vendor/bin/phpstan clear-result-cache -c scripts/phpstan/config.neon", "set_versions": "sh bin/dev/set_composer_versions" }, "suggest": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist deleted file mode 100644 index 74bc0ef..0000000 --- a/phpstan.neon.dist +++ /dev/null @@ -1,11 +0,0 @@ -includes: - - phpstan-baseline.neon - -parameters: - level: 7 - reportUnmatchedIgnoredErrors: false - - paths: - - bin - - src - - tests diff --git a/phpstan-baseline.neon b/scripts/phpstan/baseline.neon similarity index 78% rename from phpstan-baseline.neon rename to scripts/phpstan/baseline.neon index ebd3764..9ad7ad6 100644 --- a/phpstan-baseline.neon +++ b/scripts/phpstan/baseline.neon @@ -4,59 +4,59 @@ parameters: message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#' identifier: method.unresolvableReturnType count: 2 - path: tests/Unit/BaselineBuilderTest.php + path: ../../tests/Unit/BaselineBuilderTest.php - message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#' identifier: method.unresolvableReturnType count: 4 - path: tests/Unit/BaselineTransformer/AwareTransformerTest.php + path: ../../tests/Unit/BaselineTransformer/AwareTransformerTest.php - message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#' identifier: method.unresolvableReturnType count: 2 - path: tests/Unit/ComparatorTest.php + path: ../../tests/Unit/ComparatorTest.php - message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#' identifier: method.unresolvableReturnType count: 1 - path: tests/Unit/Model/ConsoleTableTest.php + path: ../../tests/Unit/Model/ConsoleTableTest.php - message: '#^Expression "\$coverage\[''any_key''\]" on a separate line does not do anything\.$#' identifier: expr.resultUnused count: 2 - path: tests/Unit/Model/CoverageTest.php + path: ../../tests/Unit/Model/CoverageTest.php - message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#' identifier: method.unresolvableReturnType count: 2 - path: tests/Unit/Reader/BaselineTransformingReaderTest.php + path: ../../tests/Unit/Reader/BaselineTransformingReaderTest.php - message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectExceptionMess…'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 - path: tests/Unit/UnitTestCase.php + path: ../../tests/Unit/UnitTestCase.php - message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectWarning'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 - path: tests/Unit/UnitTestCase.php + path: ../../tests/Unit/UnitTestCase.php - message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectWarningMessag…'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 - path: tests/Unit/UnitTestCase.php + path: ../../tests/Unit/UnitTestCase.php - message: '#^Parameter \#1 \$json of function json_decode expects string, string\|false given\.$#' identifier: argument.type count: 1 - path: tests/Unit/Writer/BaselineWriterTest.php + path: ../../tests/Unit/Writer/BaselineWriterTest.php diff --git a/scripts/phpstan/config.neon b/scripts/phpstan/config.neon new file mode 100644 index 0000000..8e9b31f --- /dev/null +++ b/scripts/phpstan/config.neon @@ -0,0 +1,11 @@ +includes: + - ../../scripts/phpstan/baseline.neon + +parameters: + level: 7 + reportUnmatchedIgnoredErrors: false + + paths: + - ../../bin + - ../../src + - ../../tests