From 4dfb4cb69baa546fb5499f9be8df31f82d828559 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 16 Jul 2026 14:24:45 +0200 Subject: [PATCH 1/7] Fix build --- build/enums.neon | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build/enums.neon b/build/enums.neon index 44eaccbbd14..964c049e3a0 100644 --- a/build/enums.neon +++ b/build/enums.neon @@ -17,3 +17,15 @@ parameters: message: '#^Class CustomDeprecations\\MyDeprecatedEnum not found\.$#' paths: - ../tests/PHPStan/Reflection/Deprecation/DeprecationProviderTest.php + - + rawMessage: "Value 'ReflectionEnum' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.ph + - + rawMessage: "Value 'ReflectionEnumBackedCase' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.ph + - + rawMessage: "Value 'ReflectionFiber' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.ph From 7d52cabd6e9fd411d1777c893935d28d3e2827ab Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 16 Jul 2026 14:40:14 +0200 Subject: [PATCH 2/7] Update enums.neon --- build/enums.neon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/enums.neon b/build/enums.neon index 964c049e3a0..c62e6a4fd2b 100644 --- a/build/enums.neon +++ b/build/enums.neon @@ -20,12 +20,12 @@ parameters: - rawMessage: "Value 'ReflectionEnum' in the haystack passed to in_array() can never be identical to the needle type class-string." paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.ph + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php - rawMessage: "Value 'ReflectionEnumBackedCase' in the haystack passed to in_array() can never be identical to the needle type class-string." paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.ph + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php - rawMessage: "Value 'ReflectionFiber' in the haystack passed to in_array() can never be identical to the needle type class-string." paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.ph + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php From 04ad853e807e5c155eeb895c14c2fbab45c38271 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 16 Jul 2026 14:40:29 +0200 Subject: [PATCH 3/7] cs --- .../SourceLocator/OptimizedDirectorySourceLocator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php b/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php index 16230fd0843..b83b5a35a17 100644 --- a/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php +++ b/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php @@ -15,9 +15,9 @@ use PHPStan\BetterReflection\SourceLocator\Ast\Strategy\NodeToReflection; use PHPStan\BetterReflection\SourceLocator\Type\SourceLocator; use PHPStan\Cache\ArenaCache; -use PHPStan\File\FileContentHasher; use PHPStan\Cache\Cache; use PHPStan\File\CouldNotReadFileException; +use PHPStan\File\FileContentHasher; use PHPStan\Internal\ComposerHelper; use PHPStan\Php\PhpVersion; use PHPStan\Reflection\ConstantNameHelper; From a81193d0384f462081b974a74fd1ab167e44fe16 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 16 Jul 2026 14:46:37 +0200 Subject: [PATCH 4/7] fix --- build/baseline-7.4.neon | 14 ++++++++++++++ build/enums.neon | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/build/baseline-7.4.neon b/build/baseline-7.4.neon index 7dee4eae344..dda756663d0 100644 --- a/build/baseline-7.4.neon +++ b/build/baseline-7.4.neon @@ -77,3 +77,17 @@ parameters: message: "#^Class PHPStan\\\\Reflection\\\\BetterReflection\\\\SourceLocator\\\\CachingVisitor has an uninitialized property \\$constantNodes\\. Give it default value or assign it in the constructor\\.$#" count: 1 path: ../src/Reflection/BetterReflection/SourceLocator/CachingVisitor.php + + - + rawMessage: "Value 'ReflectionEnumBacke…' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php + + - + rawMessage: "Value 'ReflectionEnum' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php + - + rawMessage: "Value 'ReflectionFiber' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php diff --git a/build/enums.neon b/build/enums.neon index c62e6a4fd2b..44eaccbbd14 100644 --- a/build/enums.neon +++ b/build/enums.neon @@ -17,15 +17,3 @@ parameters: message: '#^Class CustomDeprecations\\MyDeprecatedEnum not found\.$#' paths: - ../tests/PHPStan/Reflection/Deprecation/DeprecationProviderTest.php - - - rawMessage: "Value 'ReflectionEnum' in the haystack passed to in_array() can never be identical to the needle type class-string." - paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php - - - rawMessage: "Value 'ReflectionEnumBackedCase' in the haystack passed to in_array() can never be identical to the needle type class-string." - paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php - - - rawMessage: "Value 'ReflectionFiber' in the haystack passed to in_array() can never be identical to the needle type class-string." - paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php From e30e982729ddd5573fe5c391e0a6d5a036beb5d7 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 16 Jul 2026 14:47:36 +0200 Subject: [PATCH 5/7] fix --- build/baseline-7.4.neon | 4 ---- build/enums.neon | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/baseline-7.4.neon b/build/baseline-7.4.neon index dda756663d0..3cf308d4391 100644 --- a/build/baseline-7.4.neon +++ b/build/baseline-7.4.neon @@ -87,7 +87,3 @@ parameters: rawMessage: "Value 'ReflectionEnum' in the haystack passed to in_array() can never be identical to the needle type class-string." paths: - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php - - - rawMessage: "Value 'ReflectionFiber' in the haystack passed to in_array() can never be identical to the needle type class-string." - paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php diff --git a/build/enums.neon b/build/enums.neon index 44eaccbbd14..d2586bab154 100644 --- a/build/enums.neon +++ b/build/enums.neon @@ -17,3 +17,8 @@ parameters: message: '#^Class CustomDeprecations\\MyDeprecatedEnum not found\.$#' paths: - ../tests/PHPStan/Reflection/Deprecation/DeprecationProviderTest.php + + - + rawMessage: "Value 'ReflectionFiber' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php From 09c81f367b8f9a7cd9f1d69502ef0a3b7c1fc3df Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 16 Jul 2026 14:55:46 +0200 Subject: [PATCH 6/7] move --- build/baseline-7.4.neon | 5 ----- build/more-enum-adapter-errors.neon | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/baseline-7.4.neon b/build/baseline-7.4.neon index 3cf308d4391..10be043285b 100644 --- a/build/baseline-7.4.neon +++ b/build/baseline-7.4.neon @@ -78,11 +78,6 @@ parameters: count: 1 path: ../src/Reflection/BetterReflection/SourceLocator/CachingVisitor.php - - - rawMessage: "Value 'ReflectionEnumBacke…' in the haystack passed to in_array() can never be identical to the needle type class-string." - paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php - - rawMessage: "Value 'ReflectionEnum' in the haystack passed to in_array() can never be identical to the needle type class-string." paths: diff --git a/build/more-enum-adapter-errors.neon b/build/more-enum-adapter-errors.neon index 9a1d09049f8..65beb4e0bdf 100644 --- a/build/more-enum-adapter-errors.neon +++ b/build/more-enum-adapter-errors.neon @@ -56,3 +56,8 @@ parameters: rawMessage: 'Strict comparison using === between class-string and ''UnitEnum'' will always evaluate to false.' count: 1 path: ../src/Reflection/Php/PhpClassReflectionExtension.php + + - + rawMessage: "Value 'ReflectionEnumBacke…' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php From 150b43eef5e9d2fe03d13f28797d3c7cbee09048 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 16 Jul 2026 14:56:28 +0200 Subject: [PATCH 7/7] move --- build/baseline-7.4.neon | 5 ----- build/more-enum-adapter-errors.neon | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/baseline-7.4.neon b/build/baseline-7.4.neon index 10be043285b..7dee4eae344 100644 --- a/build/baseline-7.4.neon +++ b/build/baseline-7.4.neon @@ -77,8 +77,3 @@ parameters: message: "#^Class PHPStan\\\\Reflection\\\\BetterReflection\\\\SourceLocator\\\\CachingVisitor has an uninitialized property \\$constantNodes\\. Give it default value or assign it in the constructor\\.$#" count: 1 path: ../src/Reflection/BetterReflection/SourceLocator/CachingVisitor.php - - - - rawMessage: "Value 'ReflectionEnum' in the haystack passed to in_array() can never be identical to the needle type class-string." - paths: - - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php diff --git a/build/more-enum-adapter-errors.neon b/build/more-enum-adapter-errors.neon index 65beb4e0bdf..981ae5635e6 100644 --- a/build/more-enum-adapter-errors.neon +++ b/build/more-enum-adapter-errors.neon @@ -61,3 +61,8 @@ parameters: rawMessage: "Value 'ReflectionEnumBacke…' in the haystack passed to in_array() can never be identical to the needle type class-string." paths: - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php + + - + rawMessage: "Value 'ReflectionEnum' in the haystack passed to in_array() can never be identical to the needle type class-string." + paths: + - ../src/Rules/Api/RuntimeReflectionInstantiationRule.php