Skip to content

Commit

Permalink
Fix bug with return type self
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag committed Nov 3, 2017
1 parent bdd0409 commit a80db63
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Application/ParameterFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ private function createReflection(ReflectionClass $reflection, string $component
throw new TypeHintException(sprintf('Method %s::%s does not return a class.', $reflection->name, $method));
}
$class = (string) $type;
if ($class === 'self') {
$class = $element->getDeclaringClass()->getName();
}
if (!class_exists($class)) {
throw new TypeHintException(sprintf('Class "%s" from %s::%s return type not found.', $class, $reflection->name, $method));
}
Expand Down

0 comments on commit a80db63

Please sign in to comment.