Skip to content

Commit

Permalink
using class method rather than generic __toString() method
Browse files Browse the repository at this point in the history
  • Loading branch information
SignpostMarv committed May 10, 2018
1 parent e0487be commit ddb6e68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/StaticMethodCollector.php
Expand Up @@ -11,6 +11,7 @@
use Generator;
use ReflectionClass;
use ReflectionMethod;
use ReflectionNamedType;
use ReflectionType;
use Traversable;

Expand Down Expand Up @@ -203,7 +204,7 @@ private function FilterReflectionMethod(ReflectionMethod $refMethod) : bool

private function FilterReflectionReturnType(? ReflectionType $refReturn) : bool
{
$refReturnName = is_null($refReturn) ? '' : $refReturn->__toString();
$refReturnName = ($refReturn instanceof ReflectionNamedType) ? $refReturn->getName() : '';

return 'array' === $refReturnName || is_a($refReturnName, Traversable::class, true);
}
Expand Down

0 comments on commit ddb6e68

Please sign in to comment.