Skip to content

Commit c634aab

Browse files
committed
MicroPresenter: injects service only for non-builtin types
1 parent 83f5144 commit c634aab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Application/MicroPresenter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ public function run(Application\Request $request): Application\Response
8484

8585
if ($this->context) {
8686
foreach ($reflection->getParameters() as $param) {
87-
if ($param->getType()) {
88-
$params[$param->getName()] = $this->context->getByType($param->getType()->getName(), false);
87+
$type = $param->getType();
88+
if ($type instanceof \ReflectionNamedType && !$type->isBuiltin()) {
89+
$params[$param->getName()] = $this->context->getByType($type->getName(), false);
8990
}
9091
}
9192
}

0 commit comments

Comments
 (0)