Skip to content

Commit 923e121

Browse files
committed
SlevomatCodingStandard.Namespaces.UnusedUses: Fixed false positive thanks to PHPCS upgrade
1 parent 8d0f603 commit 923e121

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": "^7.2 || ^8.0",
2020
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0",
2121
"phpstan/phpdoc-parser": "^1.23.1",
22-
"squizlabs/php_codesniffer": "^3.7.1"
22+
"squizlabs/php_codesniffer": "^3.9.0"
2323
},
2424
"require-dev": {
2525
"phing/phing": "2.17.4",

tests/Sniffs/Namespaces/UnusedUsesSniffTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function testUnusedUse(): void
6868
self::assertNoSniffError($report, 29);
6969

7070
self::assertNoSniffError($report, 30);
71+
self::assertNoSniffError($report, 31);
7172

7273
self::assertNoSniffError($report, 91);
7374
}

tests/Sniffs/Namespaces/data/unusedUses.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use ReferenceClass;
2929
use ClassWithStaticVariable;
3030
use ClassWithConstant;
31+
use function Psl\Type\null;
3132

3233
class TestClass implements FirstInterface, SecondInterface
3334
{
@@ -67,3 +68,5 @@ protected function withUnion(UnionType|UnionType2|bool $union)
6768
}
6869

6970
}
71+
72+
null();

0 commit comments

Comments
 (0)