@@ -9,6 +9,9 @@ parameters:
99 excludePaths:
1010 # This file needs to be excluded as the availability of the traits depends on which PHPUnit Polyfills version is loaded/installed.
1111 - Tests/PolyfilledTestCase.php
12+ # These will be seen as unused due to these only being used in conjunction with the above excluded TestCase.
13+ - Tests/AssertPropertySame.php
14+ - Tests/ExpectWithConsecutiveArgs.php
1215 bootstrapFiles:
1316 - Tests/bootstrap.php
1417 treatPhpDocTypesAsCertain: false
@@ -40,6 +43,7 @@ parameters:
4043 message: '`^Call to an undefined method PHP_CodeSniffer\\Config::__destruct\(\)\.$`'
4144 path: PHPCSUtils\TestUtils\UtilityMethodTestCase.php
4245 count: 1
46+
4347 # The setStaticConfigProperty() method exists on the ConfigDouble, not the PHPCS native Config. This is 100% okay.
4448 -
4549 message: '`^Call to an undefined method PHP_CodeSniffer\\Config::setStaticConfigProperty\(\)\.$`'
@@ -50,6 +54,7 @@ parameters:
5054 -
5155 message: '`^Call to an undefined method PHPUnit\\Framework\\MockObject\\MockObject::process\(\)\.$`'
5256 path: Tests/AbstractSniffs/AbstractArrayDeclaration/AbstractArrayDeclarationSniffTest.php
57+
5358 # Ignoring as availability depends on which PHPUnit version is loaded/installed. This is 100% okay.
5459 -
5560 message: '`^Call to an undefined method PHPUnit\\Framework\\MockObject\\MockBuilder<[^>]+>::setMethods\(\)\.$`'
@@ -64,33 +69,57 @@ parameters:
6469 path: Tests/BackCompat/Helper/GetCommandLineDataTest.php
6570
6671 # Level 4
72+ # Defensive coding as this project is not type safe. This is okay.
73+ -
74+ message: '`^Call to function is_string\(\) with string will always evaluate to true\.$`'
75+ path: PHPCSUtils/Utils/TypeString.php
76+ count: 1
77+
6778 # This is by design.
6879 -
6980 message: '`^Static method PHPCSUtils\\Tokens\\Collections::triggerDeprecation\(\) is unused\.$`'
7081 path: PHPCSUtils/Tokens/Collections.php
7182 count: 1
7283
73- # Ignoring this as availability depends on which PHPUnit Polyfills version is loaded/installed. This is 100% okay.
84+ # Ignoring these as availability depends on which PHPUnit/ PHPUnit Polyfills version is loaded/installed. This is 100% okay.
7485 -
7586 message: "`^Call to function method_exists\\(\\) with \\$this\\([^)]+\\) and 'expectError' will always evaluate to false\\.$`"
7687 path: Tests/Utils/TypeString/FilterTypesTest.php
7788 count: 2
89+ -
90+ message: "`^Call to function method_exists\\(\\) with \\$this\\([^)]+\\) and 'expectException' will always evaluate to true\\.$`"
91+ path: PHPCSUtils/TestUtils/UtilityMethodTestCase.php
92+ count: 1
93+ -
94+ message: "`^Call to function method_exists\\(\\) with PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder and 'onlyMethods' will always evaluate to true\\.$`"
95+ path: Tests/AbstractSniffs/AbstractArrayDeclaration/AbstractArrayDeclarationSniffTest.php
96+ count: 1
7897
7998 # Level 5
8099 # This is by design to test handling of incorrect input.
81100 -
82101 message: '`^Parameter #[0-9]+ \$\S+ of static method PHPCSUtils\\(?!Tests)[A-Za-z]+\\[A-Za-z]+::[A-Za-z]+\(\) expects [^,]+, \S+ given\.$`'
83102 paths:
84- - Tests/*
103+ - Tests/
85104 -
86105 message: '`^Parameter #[0-9]+ \$\S+ of class PHPCSUtils\\(?!Tests)[A-Za-z]+\\[A-Za-z]+ [A-Za-z]+ expects [^,]+, \S+ given\.$`'
87106 path: Tests/Internal/IsShortArrayOrList/ConstructorTest.php
88107 count: 1
108+ -
109+ message: '`^Parameter #1 \$types of static method PHPCSUtils\\Utils\\TypeString::filter\S+\(\) expects array<[^<>]+(<[^<>]+>[^<>]+)*>, array<[^<>]+(<[^<>]+>[^<>]+)*> given\.$`'
110+ path: Tests/Utils/TypeString/FilterTypesTest.php
111+ count: 2
89112
90113 # Ignoring as this is fine.
91114 -
92115 message: '`^Parameter #1 \$exception of method PHPUnit\\Framework\\TestCase::expectException\(\) expects class-string<Throwable>, string given\.$`'
93116 path: Tests/Utils/TypeString/FilterTypesTest.php
94117 count: 2
95118
96- # yamllint enable rule:line-length
119+ # Shortcoming of PHPStan, not a real error.
120+ -
121+ message: '`^Parameter #1 \$expected of method PHPUnit\\Framework\\Assert::assertSame\(\) contains unresolvable type\.$`'
122+ paths:
123+ - Tests/
124+
125+ # yamllint enable rule:line-length
0 commit comments