Skip to content

Commit 2d93d16

Browse files
committed
Service locator dynamic return type extension - support createService
1 parent d3623c7 commit 2d93d16

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Type/Nette/ServiceLocatorDynamicReturnTypeExtension.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ public function isMethodSupported(MethodReflection $methodReflection): bool
2525
'getByType',
2626
'createInstance',
2727
'getService',
28+
'createService',
2829
], true);
2930
}
3031

3132
public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
3233
{
3334
$mixedType = new MixedType();
34-
if ($methodReflection->getName() === 'getService') {
35+
if (in_array($methodReflection->getName(), [
36+
'getService',
37+
'createService',
38+
], true)) {
3539
return $mixedType;
3640
}
3741
if (count($methodCall->args) === 0) {

0 commit comments

Comments
 (0)