Skip to content

Move config of PHPStan into ./scripts directory #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 11, 2024
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
14 changes: 11 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
11 changes: 0 additions & 11 deletions phpstan.neon.dist

This file was deleted.

20 changes: 10 additions & 10 deletions phpstan-baseline.neon → scripts/phpstan/baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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

11 changes: 11 additions & 0 deletions scripts/phpstan/config.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
includes:
- ../../scripts/phpstan/baseline.neon

parameters:
level: 7
reportUnmatchedIgnoredErrors: false

paths:
- ../../bin
- ../../src
- ../../tests
Loading