Skip to content

Commit a32c1d0

Browse files
authored
Merge pull request #35 from Aeliot-Tm/phpstan-config
Move config of PHPStan into ./scripts directory
2 parents 4cae1e6 + d2d3888 commit a32c1d0

File tree

4 files changed

+32
-24
lines changed

4 files changed

+32
-24
lines changed

composer.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,20 @@
4646
"scripts": {
4747
"test": [
4848
"@phpunit",
49-
"@phpstan-analise"
49+
"@phpstan"
5050
],
5151
"phive-install": "phive install --trust-gpg-keys $(cat .phive/trust-gpg-keys.txt)",
5252
"phpunit": "vendor/bin/phpunit",
53-
"phpstan-analise": "vendor/bin/phpstan analyse",
54-
"phpstan-update": "vendor/bin/phpstan analyse --generate-baseline phpstan-baseline.neon",
53+
"phpstan": [
54+
"@phpstan-clear",
55+
"@phpstan-analyse"
56+
],
57+
"phpstan-analise": "vendor/bin/phpstan analyse -c scripts/phpstan/config.neon",
58+
"phpstan-baseline": [
59+
"@phpstan-clear",
60+
"@phpstan-analise --generate-baseline phpstan-baseline.neon"
61+
],
62+
"phpstan-clear": "vendor/bin/phpstan clear-result-cache -c scripts/phpstan/config.neon",
5563
"set_versions": "sh bin/dev/set_composer_versions"
5664
},
5765
"suggest": {

phpstan.neon.dist

Lines changed: 0 additions & 11 deletions
This file was deleted.

phpstan-baseline.neon renamed to scripts/phpstan/baseline.neon

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,59 @@ parameters:
44
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
55
identifier: method.unresolvableReturnType
66
count: 2
7-
path: tests/Unit/BaselineBuilderTest.php
7+
path: ../../tests/Unit/BaselineBuilderTest.php
88

99
-
1010
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
1111
identifier: method.unresolvableReturnType
1212
count: 4
13-
path: tests/Unit/BaselineTransformer/AwareTransformerTest.php
13+
path: ../../tests/Unit/BaselineTransformer/AwareTransformerTest.php
1414

1515
-
1616
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
1717
identifier: method.unresolvableReturnType
1818
count: 2
19-
path: tests/Unit/ComparatorTest.php
19+
path: ../../tests/Unit/ComparatorTest.php
2020

2121
-
2222
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
2323
identifier: method.unresolvableReturnType
2424
count: 1
25-
path: tests/Unit/Model/ConsoleTableTest.php
25+
path: ../../tests/Unit/Model/ConsoleTableTest.php
2626

2727
-
2828
message: '#^Expression "\$coverage\[''any_key''\]" on a separate line does not do anything\.$#'
2929
identifier: expr.resultUnused
3030
count: 2
31-
path: tests/Unit/Model/CoverageTest.php
31+
path: ../../tests/Unit/Model/CoverageTest.php
3232

3333
-
3434
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
3535
identifier: method.unresolvableReturnType
3636
count: 2
37-
path: tests/Unit/Reader/BaselineTransformingReaderTest.php
37+
path: ../../tests/Unit/Reader/BaselineTransformingReaderTest.php
3838

3939
-
4040
message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectExceptionMess…'' will always evaluate to true\.$#'
4141
identifier: function.alreadyNarrowedType
4242
count: 1
43-
path: tests/Unit/UnitTestCase.php
43+
path: ../../tests/Unit/UnitTestCase.php
4444

4545
-
4646
message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectWarning'' will always evaluate to true\.$#'
4747
identifier: function.alreadyNarrowedType
4848
count: 1
49-
path: tests/Unit/UnitTestCase.php
49+
path: ../../tests/Unit/UnitTestCase.php
5050

5151
-
5252
message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectWarningMessag…'' will always evaluate to true\.$#'
5353
identifier: function.alreadyNarrowedType
5454
count: 1
55-
path: tests/Unit/UnitTestCase.php
55+
path: ../../tests/Unit/UnitTestCase.php
5656

5757
-
5858
message: '#^Parameter \#1 \$json of function json_decode expects string, string\|false given\.$#'
5959
identifier: argument.type
6060
count: 1
61-
path: tests/Unit/Writer/BaselineWriterTest.php
61+
path: ../../tests/Unit/Writer/BaselineWriterTest.php
6262

scripts/phpstan/config.neon

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
includes:
2+
- ../../scripts/phpstan/baseline.neon
3+
4+
parameters:
5+
level: 7
6+
reportUnmatchedIgnoredErrors: false
7+
8+
paths:
9+
- ../../bin
10+
- ../../src
11+
- ../../tests

0 commit comments

Comments
 (0)