diff --git a/src/ReturnEntity.php b/src/ReturnEntity.php index 253e534e..21b2f355 100644 --- a/src/ReturnEntity.php +++ b/src/ReturnEntity.php @@ -16,6 +16,7 @@ use function assert; use function class_exists; +use function is_a; use function substr; final class ReturnEntity implements ReturnEntityInterface @@ -30,7 +31,7 @@ public function __invoke(ReflectionMethod $method): string|null $returnTypeClass = $this->getReturnTypeName($returnType); - if (class_exists($returnTypeClass) && $returnTypeClass !== Pages::class) { + if (class_exists($returnTypeClass) && ! is_a($returnTypeClass, PagesInterface::class, true)) { return $returnTypeClass; }