Skip to content

Commit

Permalink
Support a class of implementing PagesInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
NaokiTsuchiya committed Feb 24, 2023
1 parent 55054fa commit e41dc2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ReturnEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use function assert;
use function class_exists;
use function is_a;
use function substr;

final class ReturnEntity implements ReturnEntityInterface
Expand All @@ -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;
}

Expand Down

0 comments on commit e41dc2f

Please sign in to comment.