Skip to content

Commit e40ba15

Browse files
committed
Moved some classes from ClassBlacklistReflectionProvider to staticReflectionClassNamePatterns config so that they are in effect for ClassBlacklistSourceLocator too
1 parent 0322c32 commit e40ba15

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

Diff for: conf/config.neon

+9
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ parameters:
102102
- '#^Symfony\\Polyfill\\Php72\\#i'
103103
- '#^Symfony\\Polyfill\\Intl\\Grapheme\\#i'
104104
- '#^Composer\\#i'
105+
- '#^ReflectionUnionType$#i'
106+
- '#^Attribute$#i'
107+
- '#^ReturnTypeWillChange$#i'
108+
- '#^ReflectionIntersectionType$#i'
109+
- '#^UnitEnum$#i'
110+
- '#^BackedEnum$#i'
111+
- '#^ReflectionEnum$#i'
112+
- '#^ReflectionEnumUnitCase$#i'
113+
- '#^ReflectionEnumBackedCase$#i'
105114
dynamicConstantNames:
106115
- ICONV_IMPL
107116
- LIBXML_VERSION

Diff for: src/Reflection/ReflectionProvider/ClassBlacklistReflectionProvider.php

-15
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
use PHPStan\ShouldNotHappenException;
1515
use ReflectionClass;
1616
use function class_exists;
17-
use function in_array;
18-
use function strtolower;
1917

2018
class ClassBlacklistReflectionProvider implements ReflectionProvider
2119
{
@@ -85,19 +83,6 @@ private function isClassBlacklisted(string $className): bool
8583
if (!class_exists($className, false)) {
8684
return true;
8785
}
88-
if (in_array(strtolower($className), [
89-
'reflectionuniontype',
90-
'attribute',
91-
'returntypewillchange',
92-
'reflectionintersectiontype',
93-
'unitenum',
94-
'backedenum',
95-
'reflectionenum',
96-
'reflectionenumunitcase',
97-
'reflectionenumbackedcase',
98-
], true)) {
99-
return true;
100-
}
10186
$reflection = new ReflectionClass($className);
10287
if ($reflection->getFileName() === false) {
10388
return true;

0 commit comments

Comments
 (0)