Skip to content

Commit a80db63

Browse files
committed
Fix bug with return type self
1 parent bdd0409 commit a80db63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Application/ParameterFinder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ private function createReflection(ReflectionClass $reflection, string $component
166166
throw new TypeHintException(sprintf('Method %s::%s does not return a class.', $reflection->name, $method));
167167
}
168168
$class = (string) $type;
169+
if ($class === 'self') {
170+
$class = $element->getDeclaringClass()->getName();
171+
}
169172
if (!class_exists($class)) {
170173
throw new TypeHintException(sprintf('Class "%s" from %s::%s return type not found.', $class, $reflection->name, $method));
171174
}

0 commit comments

Comments
 (0)