Skip to content

Commit

Permalink
Moved some classes from ClassBlacklistReflectionProvider to staticRef…
Browse files Browse the repository at this point in the history
…lectionClassNamePatterns config so that they are in effect for ClassBlacklistSourceLocator too
  • Loading branch information
ondrejmirtes committed Dec 28, 2021
1 parent 0322c32 commit e40ba15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
9 changes: 9 additions & 0 deletions conf/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ parameters:
- '#^Symfony\\Polyfill\\Php72\\#i'
- '#^Symfony\\Polyfill\\Intl\\Grapheme\\#i'
- '#^Composer\\#i'
- '#^ReflectionUnionType$#i'
- '#^Attribute$#i'
- '#^ReturnTypeWillChange$#i'
- '#^ReflectionIntersectionType$#i'
- '#^UnitEnum$#i'
- '#^BackedEnum$#i'
- '#^ReflectionEnum$#i'
- '#^ReflectionEnumUnitCase$#i'
- '#^ReflectionEnumBackedCase$#i'
dynamicConstantNames:
- ICONV_IMPL
- LIBXML_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
use PHPStan\ShouldNotHappenException;
use ReflectionClass;
use function class_exists;
use function in_array;
use function strtolower;

class ClassBlacklistReflectionProvider implements ReflectionProvider
{
Expand Down Expand Up @@ -85,19 +83,6 @@ private function isClassBlacklisted(string $className): bool
if (!class_exists($className, false)) {
return true;
}
if (in_array(strtolower($className), [
'reflectionuniontype',
'attribute',
'returntypewillchange',
'reflectionintersectiontype',
'unitenum',
'backedenum',
'reflectionenum',
'reflectionenumunitcase',
'reflectionenumbackedcase',
], true)) {
return true;
}
$reflection = new ReflectionClass($className);
if ($reflection->getFileName() === false) {
return true;
Expand Down

0 comments on commit e40ba15

Please sign in to comment.