Skip to content

Commit

Permalink
Merge pull request #8080 from zoonru/fix_reflection_aliases
Browse files Browse the repository at this point in the history
Skip native classlike aliases
  • Loading branch information
orklah committed Jun 12, 2022
2 parents a9775c6 + d352ae4 commit c74b2fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Psalm/Internal/Codebase/ClassLikes.php
Expand Up @@ -188,7 +188,7 @@ private function collectPredefinedClassLikes(): void
/** @psalm-suppress ArgumentTypeCoercion */
$reflection_class = new ReflectionClass($predefined_class);

if (!$reflection_class->isUserDefined()) {
if (!$reflection_class->isUserDefined() && $reflection_class->name === $predefined_class) {
$predefined_class_lc = strtolower($predefined_class);
$this->existing_classlikes_lc[$predefined_class_lc] = true;
$this->existing_classes_lc[$predefined_class_lc] = true;
Expand All @@ -204,7 +204,7 @@ private function collectPredefinedClassLikes(): void
/** @psalm-suppress ArgumentTypeCoercion */
$reflection_class = new ReflectionClass($predefined_interface);

if (!$reflection_class->isUserDefined()) {
if (!$reflection_class->isUserDefined() && $reflection_class->name === $predefined_interface) {
$predefined_interface_lc = strtolower($predefined_interface);
$this->existing_classlikes_lc[$predefined_interface_lc] = true;
$this->existing_interfaces_lc[$predefined_interface_lc] = true;
Expand Down

0 comments on commit c74b2fc

Please sign in to comment.