Make unit tests working

This commit is contained in:
Eric Espie
2025-10-02 09:48:22 +02:00
parent 0ea0da525e
commit 39fd879ca9
83 changed files with 1924 additions and 262 deletions

View File

@@ -118,7 +118,7 @@ final class PhpDocTypeHelper
[$phpType, $class] = $this->getPhpTypeAndClass((string) $fqsen);
$collection = \is_a($class, \Traversable::class, true) || \is_a($class, \ArrayAccess::class, true);
$collection = is_a($class, \Traversable::class, true) || is_a($class, \ArrayAccess::class, true);
// it's safer to fall back to other extractors if the generic type is too abstract
if (!$collection && !class_exists($class)) {

View File

@@ -125,7 +125,7 @@ final class PhpStanTypeHelper
return [$mainType];
}
$collection = $mainType->isCollection() || \is_a($mainType->getClassName(), \Traversable::class, true) || \is_a($mainType->getClassName(), \ArrayAccess::class, true);
$collection = $mainType->isCollection() || is_a($mainType->getClassName(), \Traversable::class, true) || is_a($mainType->getClassName(), \ArrayAccess::class, true);
// it's safer to fall back to other extractors if the generic type is too abstract
if (!$collection && !class_exists($mainType->getClassName()) && !interface_exists($mainType->getClassName(), false)) {