-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
phpstan.neon.dist
125 lines (110 loc) · 6.02 KB
/
phpstan.neon.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
parameters:
# phpVersion: 50400 # Needs to be 70100 or higher... sigh...
level: 6
paths:
- phpcsutils-autoload.php
- .github/GHPages
- PHPCSUtils
- Tests
excludePaths:
# This file needs to be excluded as the availability of the traits depends on which PHPUnit Polyfills version is loaded/installed.
- Tests/PolyfilledTestCase.php
# These will be seen as unused due to these only being used in conjunction with the above excluded TestCase.
- Tests/AssertPropertySame.php
- Tests/ExpectWithConsecutiveArgs.php
bootstrapFiles:
- Tests/bootstrap.php
treatPhpDocTypesAsCertain: false
ignoreErrors:
# yamllint disable rule:line-length
# Level 0
# Ignoring this as availability depends on which PHPUnit Polyfills version is loaded/installed. This is 100% okay.
-
message: '`^Call to an undefined method \S+UtilityMethodTestCase::setExpectedException\(\)\.$`'
path: PHPCSUtils/TestUtils/UtilityMethodTestCase.php
count: 1
# Level 1
# These are on purpose for testing the magic method. This is 100% okay.
-
message: '`^Call to an undefined static method PHPCSUtils\\BackCompat\\BCTokens::notATokenArray\(\)\.$`'
path: Tests/BackCompat/BCTokens/UnchangedTokenArraysTest.php
count: 1
-
message: '`^Call to an undefined static method PHPCSUtils\\Tokens\\Collections::notATokenArray\(\)\.$`'
path: Tests/Tokens/Collections/PropertyBasedTokenArraysTest.php
count: 1
# Level 2
# The __destruct() method exists on the ConfigDouble, not the PHPCS native Config. This is 100% okay.
-
message: '`^Call to an undefined method PHP_CodeSniffer\\Config::__destruct\(\)\.$`'
path: PHPCSUtils/TestUtils/UtilityMethodTestCase.php
count: 1
# The setStaticConfigProperty() method exists on the ConfigDouble, not the PHPCS native Config. This is 100% okay.
-
message: '`^Call to an undefined method PHP_CodeSniffer\\Config::setStaticConfigProperty\(\)\.$`'
path: Tests/TestUtils/UtilityMethodTestCase\ResetTestFileTest.php
count: 1
# Ignoring as this refers to a non-mocked method on the original class. This is 100% okay.
-
message: '`^Call to an undefined method PHPUnit\\Framework\\MockObject\\MockObject::process\(\)\.$`'
path: Tests/AbstractSniffs/AbstractArrayDeclaration/AbstractArrayDeclarationSniffTest.php
# Ignoring as availability depends on which PHPUnit version is loaded/installed. This is 100% okay.
-
message: '`^Call to an undefined method PHPUnit\\Framework\\MockObject\\MockBuilder<[^>]+>::setMethods\(\)\.$`'
path: Tests/AbstractSniffs/AbstractArrayDeclaration/AbstractArrayDeclarationSniffTest.php
count: 1
# Level 3
# Ignoring as `null` is the initial value for config settings in PHPCS which this test is resetting to.
# The PHPCS docs just don't reflect that. This is 100% okay.
-
message: '`^Property PHP_CodeSniffer\\Config::\$\S+ \([^\)]+\) does not accept null\.$`'
path: Tests/BackCompat/Helper/GetCommandLineDataTest.php
# Level 4
# Defensive coding as this project is not type safe. This is okay.
-
message: '`^Call to function is_string\(\) with string will always evaluate to true\.$`'
path: PHPCSUtils/Utils/TypeString.php
count: 1
# This is by design.
-
message: '`^Static method PHPCSUtils\\Tokens\\Collections::triggerDeprecation\(\) is unused\.$`'
path: PHPCSUtils/Tokens/Collections.php
count: 1
# Ignoring these as availability depends on which PHPUnit/PHPUnit Polyfills version is loaded/installed. This is 100% okay.
-
message: "`^Call to function method_exists\\(\\) with \\$this\\([^)]+\\) and 'expectError' will always evaluate to false\\.$`"
path: Tests/Utils/TypeString/FilterTypesTest.php
count: 2
-
message: "`^Call to function method_exists\\(\\) with \\$this\\([^)]+\\) and 'expectException' will always evaluate to true\\.$`"
path: PHPCSUtils/TestUtils/UtilityMethodTestCase.php
count: 1
-
message: "`^Call to function method_exists\\(\\) with PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder and 'onlyMethods' will always evaluate to true\\.$`"
path: Tests/AbstractSniffs/AbstractArrayDeclaration/AbstractArrayDeclarationSniffTest.php
count: 1
# Level 5
# This is by design to test handling of incorrect input.
-
message: '`^Parameter #[0-9]+ \$\S+ of static method PHPCSUtils\\(?!Tests)[A-Za-z]+\\[A-Za-z]+::[A-Za-z]+\(\) expects [^,]+, \S+ given\.$`'
paths:
- Tests/
-
message: '`^Parameter #[0-9]+ \$\S+ of class PHPCSUtils\\(?!Tests)[A-Za-z]+\\[A-Za-z]+ [A-Za-z]+ expects [^,]+, \S+ given\.$`'
path: Tests/Internal/IsShortArrayOrList/ConstructorTest.php
count: 1
-
message: '`^Parameter #1 \$types of static method PHPCSUtils\\Utils\\TypeString::filter\S+\(\) expects array<[^<>]+(<[^<>]+>[^<>]+)*>, array<[^<>]+(<[^<>]+>[^<>]+)*> given\.$`'
path: Tests/Utils/TypeString/FilterTypesTest.php
count: 2
# Ignoring as this is fine.
-
message: '`^Parameter #1 \$exception of method PHPUnit\\Framework\\TestCase::expectException\(\) expects class-string<Throwable>, string given\.$`'
path: Tests/Utils/TypeString/FilterTypesTest.php
count: 2
# Shortcoming of PHPStan, not a real error.
-
message: '`^Parameter #1 \$expected of method PHPUnit\\Framework\\Assert::assertSame\(\) contains unresolvable type\.$`'
paths:
- Tests/
# yamllint enable rule:line-length