Skip to content

Commit

Permalink
TypeUtils::getDirectClassNames() - return unique list of class names
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jun 13, 2022
1 parent bca6372 commit b85fce0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Type/TypeUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use PHPStan\Type\Enum\EnumCaseObjectType;
use PHPStan\Type\Generic\TemplateType;
use function array_merge;
use function array_unique;
use function array_values;

/** @api */
class TypeUtils
Expand Down Expand Up @@ -150,7 +152,7 @@ public static function getDirectClassNames(Type $type): array
}
}

return $classNames;
return array_values(array_unique($classNames));
}

return [];
Expand Down

0 comments on commit b85fce0

Please sign in to comment.