From 90c68c1d74a9566f35e618093771872d654e66b8 Mon Sep 17 00:00:00 2001 From: phpstan-bot <79867460+phpstan-bot@users.noreply.github.com> Date: Fri, 15 May 2026 16:02:59 +0000 Subject: [PATCH 01/10] Skip class name case check for type hints using explicit `use ... as` aliases - Add `UseAliasVisitor` parser visitor that tracks explicit `use ... as` aliases and sets an `isExplicitUseAlias` attribute on resolved Name nodes whose original name matches an explicit alias exactly (case-sensitively) - In `FunctionDefinitionCheck::getOriginalClassNamePairsFromTypeNode()`, skip the case sensitivity check when the Name node is marked as an explicit alias - The false positive occurred because the method reconstructed the original-case class name by combining the resolved namespace prefix with the original alias name, producing e.g. `Foo\myclass` when the alias was `myclass` for `Foo\MyClass`, which was then incorrectly flagged as a case mismatch - Verified that analogous contexts (new, instanceof, catch, extends, implements, trait use, static access, PHPDoc types) are not affected because they pass the fully-resolved class name directly to `ClassCaseSensitivityCheck` --- src/Parser/UseAliasVisitor.php | 73 +++++++++++++++++++ src/Rules/FunctionDefinitionCheck.php | 5 ++ .../ExistingClassesInTypehintsRuleTest.php | 5 ++ .../PHPStan/Rules/Methods/data/bug-14617.php | 19 +++++ 4 files changed, 102 insertions(+) create mode 100644 src/Parser/UseAliasVisitor.php create mode 100644 tests/PHPStan/Rules/Methods/data/bug-14617.php diff --git a/src/Parser/UseAliasVisitor.php b/src/Parser/UseAliasVisitor.php new file mode 100644 index 00000000000..6ddf78c723a --- /dev/null +++ b/src/Parser/UseAliasVisitor.php @@ -0,0 +1,73 @@ + alias name (original case) keyed by lowercase alias name */ + private array $explicitAliases = []; + + #[Override] + public function enterNode(Node $node): ?Node + { + if ($node instanceof Node\Stmt\Namespace_) { + $this->explicitAliases = []; + } + + if ($node instanceof Use_ && $node->type === Use_::TYPE_NORMAL) { + foreach ($node->uses as $use) { + if ($use->alias === null) { + continue; + } + + $this->explicitAliases[strtolower($use->alias->name)] = $use->alias->name; + } + } + + if ($node instanceof GroupUse) { + foreach ($node->uses as $use) { + if ($use->type !== Use_::TYPE_NORMAL && $node->type !== Use_::TYPE_NORMAL) { + continue; + } + if ($use->alias === null) { + continue; + } + + $this->explicitAliases[strtolower($use->alias->name)] = $use->alias->name; + } + } + + if ($node instanceof Name) { + $originalName = $node->getAttribute('originalName'); + if ($originalName instanceof Name) { + $originalParts = $originalName->getParts(); + if (count($originalParts) === 1) { + $lowerOriginal = strtolower($originalParts[0]); + if ( + isset($this->explicitAliases[$lowerOriginal]) + && $this->explicitAliases[$lowerOriginal] === $originalParts[0] + ) { + $node->setAttribute(self::ATTRIBUTE_NAME, true); + } + } + } + } + + return null; + } + +} diff --git a/src/Rules/FunctionDefinitionCheck.php b/src/Rules/FunctionDefinitionCheck.php index 6ef8f74b158..0f6594afadb 100644 --- a/src/Rules/FunctionDefinitionCheck.php +++ b/src/Rules/FunctionDefinitionCheck.php @@ -19,6 +19,7 @@ use PHPStan\DependencyInjection\AutowiredParameter; use PHPStan\DependencyInjection\AutowiredService; use PHPStan\Node\Printer\NodeTypePrinter; +use PHPStan\Parser\UseAliasVisitor; use PHPStan\Php\PhpVersion; use PHPStan\Reflection\ExtendedParameterReflection; use PHPStan\Reflection\ExtendedParametersAcceptor; @@ -852,6 +853,10 @@ private function getOriginalClassNamePairsFromTypeNode(Identifier|Name|ComplexTy return []; } + if ($typeNode->getAttribute(UseAliasVisitor::ATTRIBUTE_NAME) === true) { + return []; + } + $resolvedName = $typeNode->toString(); $originalParts = $originalName->getParts(); $resolvedParts = $typeNode->getParts(); diff --git a/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php b/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php index 75d808498f4..dd08b8562da 100644 --- a/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php @@ -662,4 +662,9 @@ public function testBug14205(): void $this->analyse([__DIR__ . '/data/bug-14205.php'], []); } + public function testBug14617(): void + { + $this->analyse([__DIR__ . '/data/bug-14617.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Methods/data/bug-14617.php b/tests/PHPStan/Rules/Methods/data/bug-14617.php new file mode 100644 index 00000000000..8a94720469f --- /dev/null +++ b/tests/PHPStan/Rules/Methods/data/bug-14617.php @@ -0,0 +1,19 @@ + Date: Fri, 15 May 2026 16:21:14 +0000 Subject: [PATCH 02/10] Remove redundant strtolower alias detection heuristic The UseAliasVisitor now explicitly tracks `use ... as` aliases, making the old heuristic that compared lowercase class names unnecessary. The old check was a broad approximation; the new attribute-based approach is precise. Co-Authored-By: Claude Opus 4.6 --- src/Rules/FunctionDefinitionCheck.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Rules/FunctionDefinitionCheck.php b/src/Rules/FunctionDefinitionCheck.php index 0f6594afadb..d08f598a779 100644 --- a/src/Rules/FunctionDefinitionCheck.php +++ b/src/Rules/FunctionDefinitionCheck.php @@ -871,11 +871,6 @@ private function getOriginalClassNamePairsFromTypeNode(Identifier|Name|ComplexTy $originalCaseClassName = $originalName->toString(); } - if (strtolower($originalCaseClassName) !== strtolower($resolvedName)) { - // use alias, not just a case difference - return []; - } - if ($originalCaseClassName === $resolvedName) { return []; } From 66fd083d35ebb11d2331acd669395592e1390ed2 Mon Sep 17 00:00:00 2001 From: phpstan-bot Date: Sat, 16 May 2026 09:26:13 +0000 Subject: [PATCH 03/10] Move explicit use alias check to ClassCaseSensitivityCheck The isExplicitUseAlias attribute check belongs in ClassCaseSensitivityCheck (where the case error is generated) rather than in FunctionDefinitionCheck (where class name pairs are constructed). This centralizes the alias handling alongside the existing strtolower alias skip. Co-Authored-By: Claude Opus 4.6 --- src/Rules/ClassCaseSensitivityCheck.php | 4 ++++ src/Rules/FunctionDefinitionCheck.php | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Rules/ClassCaseSensitivityCheck.php b/src/Rules/ClassCaseSensitivityCheck.php index bec217c30f3..73920291c51 100644 --- a/src/Rules/ClassCaseSensitivityCheck.php +++ b/src/Rules/ClassCaseSensitivityCheck.php @@ -4,6 +4,7 @@ use PHPStan\DependencyInjection\AutowiredParameter; use PHPStan\DependencyInjection\AutowiredService; +use PHPStan\Parser\UseAliasVisitor; use PHPStan\Reflection\ReflectionProvider; use function sprintf; use function strtolower; @@ -40,6 +41,9 @@ public function checkClassNames(array $pairs): array if (strtolower($realClassName) !== strtolower($className)) { continue; // skip class alias } + if ($pair->getNode()->getAttribute(UseAliasVisitor::ATTRIBUTE_NAME) === true) { + continue; + } if ($realClassName === $className) { continue; } diff --git a/src/Rules/FunctionDefinitionCheck.php b/src/Rules/FunctionDefinitionCheck.php index d08f598a779..c888ed886f0 100644 --- a/src/Rules/FunctionDefinitionCheck.php +++ b/src/Rules/FunctionDefinitionCheck.php @@ -19,7 +19,6 @@ use PHPStan\DependencyInjection\AutowiredParameter; use PHPStan\DependencyInjection\AutowiredService; use PHPStan\Node\Printer\NodeTypePrinter; -use PHPStan\Parser\UseAliasVisitor; use PHPStan\Php\PhpVersion; use PHPStan\Reflection\ExtendedParameterReflection; use PHPStan\Reflection\ExtendedParametersAcceptor; @@ -853,10 +852,6 @@ private function getOriginalClassNamePairsFromTypeNode(Identifier|Name|ComplexTy return []; } - if ($typeNode->getAttribute(UseAliasVisitor::ATTRIBUTE_NAME) === true) { - return []; - } - $resolvedName = $typeNode->toString(); $originalParts = $originalName->getParts(); $resolvedParts = $typeNode->getParts(); From 797f75649cc27e7f9c1040fa7d32e46ca410f18b Mon Sep 17 00:00:00 2001 From: phpstan-bot Date: Sat, 16 May 2026 09:50:30 +0000 Subject: [PATCH 04/10] Add test cases for explicit use alias in extends, implements, instanceof, and property types These contexts go through ClassCaseSensitivityCheck but not through FunctionDefinitionCheck, so they weren't covered by the previous strtolower heuristic fix. Co-Authored-By: Claude Opus 4.6 --- .../ExistingClassInClassExtendsRuleTest.php | 5 +++++ .../ExistingClassInInstanceOfRuleTest.php | 5 +++++ ...istingClassesInClassImplementsRuleTest.php | 5 +++++ .../PHPStan/Rules/Classes/data/bug-14617.php | 21 +++++++++++++++++++ .../ExistingClassesInPropertiesRuleTest.php | 5 +++++ 5 files changed, 41 insertions(+) create mode 100644 tests/PHPStan/Rules/Classes/data/bug-14617.php diff --git a/tests/PHPStan/Rules/Classes/ExistingClassInClassExtendsRuleTest.php b/tests/PHPStan/Rules/Classes/ExistingClassInClassExtendsRuleTest.php index f73cf3c97c2..f7b9da55c9c 100644 --- a/tests/PHPStan/Rules/Classes/ExistingClassInClassExtendsRuleTest.php +++ b/tests/PHPStan/Rules/Classes/ExistingClassInClassExtendsRuleTest.php @@ -153,4 +153,9 @@ public function testReadonly(): void ]); } + public function testBug14617(): void + { + $this->analyse([__DIR__ . '/data/bug-14617.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Classes/ExistingClassInInstanceOfRuleTest.php b/tests/PHPStan/Rules/Classes/ExistingClassInInstanceOfRuleTest.php index 85fdebcb5aa..30512a74c3c 100644 --- a/tests/PHPStan/Rules/Classes/ExistingClassInInstanceOfRuleTest.php +++ b/tests/PHPStan/Rules/Classes/ExistingClassInInstanceOfRuleTest.php @@ -86,4 +86,9 @@ public function testRememberClassExistsFromConstructor(): void $this->analyse([__DIR__ . '/data/remember-class-exists-from-constructor.php'], []); } + public function testBug14617(): void + { + $this->analyse([__DIR__ . '/data/bug-14617.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Classes/ExistingClassesInClassImplementsRuleTest.php b/tests/PHPStan/Rules/Classes/ExistingClassesInClassImplementsRuleTest.php index d1c031f752b..cef3fee647d 100644 --- a/tests/PHPStan/Rules/Classes/ExistingClassesInClassImplementsRuleTest.php +++ b/tests/PHPStan/Rules/Classes/ExistingClassesInClassImplementsRuleTest.php @@ -95,4 +95,9 @@ public function testBug8889(): void ]); } + public function testBug14617(): void + { + $this->analyse([__DIR__ . '/data/bug-14617.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Classes/data/bug-14617.php b/tests/PHPStan/Rules/Classes/data/bug-14617.php new file mode 100644 index 00000000000..2398a9a70fc --- /dev/null +++ b/tests/PHPStan/Rules/Classes/data/bug-14617.php @@ -0,0 +1,21 @@ +analyse([__DIR__ . '/data/intersection-types.php'], $errors); } + public function testBug14617(): void + { + $this->analyse([__DIR__ . '/../Classes/data/bug-14617.php'], []); + } + } From 1fa40f1f1a2887aca11c3d9381642e8d8d5d13ce Mon Sep 17 00:00:00 2001 From: phpstan-bot Date: Sat, 16 May 2026 10:00:17 +0000 Subject: [PATCH 05/10] Add test coverage for explicit use aliases in closures and complex types The strtolower check in ClassCaseSensitivityCheck cannot be removed because it handles class_alias() scenarios where the alias name is completely different from the real class name (e.g., FooAlias for Foo). UseAliasVisitor only tracks `use ... as` aliases, not class_alias(). Removing it causes false positives like "Class Foo referenced with incorrect case: FooAliaS" for class_alias targets. Clarified the comment to explain what the check handles. Added test coverage for closures using explicit use aliases, and for nullable/union type hints with aliases. Co-Authored-By: Claude Opus 4.6 --- src/Rules/ClassCaseSensitivityCheck.php | 2 +- .../ExistingClassesInClosureTypehintsRuleTest.php | 5 +++++ .../Rules/Functions/data/bug-14617-closure.php | 13 +++++++++++++ tests/PHPStan/Rules/Methods/data/bug-14617.php | 8 ++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tests/PHPStan/Rules/Functions/data/bug-14617-closure.php diff --git a/src/Rules/ClassCaseSensitivityCheck.php b/src/Rules/ClassCaseSensitivityCheck.php index 73920291c51..788153ff245 100644 --- a/src/Rules/ClassCaseSensitivityCheck.php +++ b/src/Rules/ClassCaseSensitivityCheck.php @@ -39,7 +39,7 @@ public function checkClassNames(array $pairs): array } $realClassName = $classReflection->getName(); if (strtolower($realClassName) !== strtolower($className)) { - continue; // skip class alias + continue; // skip class_alias() where the alias is a completely different name } if ($pair->getNode()->getAttribute(UseAliasVisitor::ATTRIBUTE_NAME) === true) { continue; diff --git a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php index cc3e770303f..7e2c5348280 100644 --- a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php @@ -73,6 +73,11 @@ public function testExistingClassInTypehint(): void ]); } + public function testBug14617(): void + { + $this->analyse([__DIR__ . '/data/bug-14617-closure.php'], []); + } + public function testValidTypehintPhp71(): void { $this->analyse([__DIR__ . '/data/closure-7.1-typehints.php'], [ diff --git a/tests/PHPStan/Rules/Functions/data/bug-14617-closure.php b/tests/PHPStan/Rules/Functions/data/bug-14617-closure.php new file mode 100644 index 00000000000..8e2d87a2aca --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/bug-14617-closure.php @@ -0,0 +1,13 @@ + Date: Sat, 16 May 2026 10:18:16 +0000 Subject: [PATCH 06/10] Add explicit test for class_alias() case sensitivity skip Adds a dedicated test that verifies the strtolower check in ClassCaseSensitivityCheck correctly skips class_alias() names that are completely different from the original class name. Previously this was only implicitly covered by line 35 of closure-typehints.php using \ReturnTypes\FooAliaS. Co-Authored-By: Claude Opus 4.6 --- ...xistingClassesInClosureTypehintsRuleTest.php | 5 +++++ .../data/class-alias-case-sensitivity.php | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php diff --git a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php index 7e2c5348280..d5efb310f76 100644 --- a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php @@ -78,6 +78,11 @@ public function testBug14617(): void $this->analyse([__DIR__ . '/data/bug-14617-closure.php'], []); } + public function testClassAliasCaseSensitivity(): void + { + $this->analyse([__DIR__ . '/data/class-alias-case-sensitivity.php'], []); + } + public function testValidTypehintPhp71(): void { $this->analyse([__DIR__ . '/data/closure-7.1-typehints.php'], [ diff --git a/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php b/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php new file mode 100644 index 00000000000..8446a12fab9 --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php @@ -0,0 +1,17 @@ + Date: Sat, 16 May 2026 10:18:26 +0000 Subject: [PATCH 07/10] Skip ExistingClassesInTypehintsRuleTest::testBug14617 for PHP < 8.0 The test data uses union types (myclass|string, myclass|int) which require PHP 8.0+ to parse. Co-Authored-By: Claude Opus 4.6 --- .../PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php b/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php index dd08b8562da..1c8f6f68532 100644 --- a/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php @@ -662,6 +662,7 @@ public function testBug14205(): void $this->analyse([__DIR__ . '/data/bug-14205.php'], []); } + #[RequiresPhp('>= 8.0.0')] public function testBug14617(): void { $this->analyse([__DIR__ . '/data/bug-14617.php'], []); From 1b0888399ac6014a832ae10482b9bf9fbe756993 Mon Sep 17 00:00:00 2001 From: phpstan-bot Date: Sat, 16 May 2026 10:30:58 +0000 Subject: [PATCH 08/10] Remove class_alias case sensitivity test to not lock in current behavior Co-Authored-By: Claude Opus 4.6 --- ...xistingClassesInClosureTypehintsRuleTest.php | 5 ----- .../data/class-alias-case-sensitivity.php | 17 ----------------- 2 files changed, 22 deletions(-) delete mode 100644 tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php diff --git a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php index d5efb310f76..7e2c5348280 100644 --- a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php @@ -78,11 +78,6 @@ public function testBug14617(): void $this->analyse([__DIR__ . '/data/bug-14617-closure.php'], []); } - public function testClassAliasCaseSensitivity(): void - { - $this->analyse([__DIR__ . '/data/class-alias-case-sensitivity.php'], []); - } - public function testValidTypehintPhp71(): void { $this->analyse([__DIR__ . '/data/closure-7.1-typehints.php'], [ diff --git a/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php b/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php deleted file mode 100644 index 8446a12fab9..00000000000 --- a/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php +++ /dev/null @@ -1,17 +0,0 @@ - Date: Sat, 16 May 2026 11:29:13 +0000 Subject: [PATCH 09/10] Add back class_alias case sensitivity test with correct-case usage only Re-adds the test for class_alias() with FooAlias using correct case, without locking in the wrong-case behavior that may be tightened later. Co-Authored-By: Claude Opus 4.6 --- .../ExistingClassesInClosureTypehintsRuleTest.php | 5 +++++ .../Rules/Functions/data/class-alias-case-sensitivity.php | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php diff --git a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php index 7e2c5348280..d5efb310f76 100644 --- a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php @@ -78,6 +78,11 @@ public function testBug14617(): void $this->analyse([__DIR__ . '/data/bug-14617-closure.php'], []); } + public function testClassAliasCaseSensitivity(): void + { + $this->analyse([__DIR__ . '/data/class-alias-case-sensitivity.php'], []); + } + public function testValidTypehintPhp71(): void { $this->analyse([__DIR__ . '/data/closure-7.1-typehints.php'], [ diff --git a/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php b/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php new file mode 100644 index 00000000000..443f5f728e3 --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/class-alias-case-sensitivity.php @@ -0,0 +1,7 @@ + Date: Sat, 16 May 2026 12:05:06 +0000 Subject: [PATCH 10/10] Add test coverage for group use statements with explicit aliases Covers the GroupUse code path in UseAliasVisitor that was not exercised by existing tests. Tests use `use Ns\{A as a, B as b}` syntax in both closure and method typehint contexts. Co-Authored-By: Claude Opus 4.6 --- ...ExistingClassesInClosureTypehintsRuleTest.php | 5 +++++ .../Rules/Functions/data/bug-14617-group-use.php | 14 ++++++++++++++ .../ExistingClassesInTypehintsRuleTest.php | 5 +++++ .../Rules/Methods/data/bug-14617-group-use.php | 16 ++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 tests/PHPStan/Rules/Functions/data/bug-14617-group-use.php create mode 100644 tests/PHPStan/Rules/Methods/data/bug-14617-group-use.php diff --git a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php index d5efb310f76..29f20f73099 100644 --- a/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Functions/ExistingClassesInClosureTypehintsRuleTest.php @@ -78,6 +78,11 @@ public function testBug14617(): void $this->analyse([__DIR__ . '/data/bug-14617-closure.php'], []); } + public function testBug14617GroupUse(): void + { + $this->analyse([__DIR__ . '/data/bug-14617-group-use.php'], []); + } + public function testClassAliasCaseSensitivity(): void { $this->analyse([__DIR__ . '/data/class-alias-case-sensitivity.php'], []); diff --git a/tests/PHPStan/Rules/Functions/data/bug-14617-group-use.php b/tests/PHPStan/Rules/Functions/data/bug-14617-group-use.php new file mode 100644 index 00000000000..74eef10803f --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/bug-14617-group-use.php @@ -0,0 +1,14 @@ +analyse([__DIR__ . '/data/bug-14617.php'], []); } + public function testBug14617GroupUse(): void + { + $this->analyse([__DIR__ . '/data/bug-14617-group-use.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Methods/data/bug-14617-group-use.php b/tests/PHPStan/Rules/Methods/data/bug-14617-group-use.php new file mode 100644 index 00000000000..607531d9a70 --- /dev/null +++ b/tests/PHPStan/Rules/Methods/data/bug-14617-group-use.php @@ -0,0 +1,16 @@ +