diff --git a/dev/PHPStan/Extensions/EntityManagerReturnType.php b/dev/PHPStan/Extensions/EntityManagerReturnType.php index ac397d45dd..9d9340c721 100644 --- a/dev/PHPStan/Extensions/EntityManagerReturnType.php +++ b/dev/PHPStan/Extensions/EntityManagerReturnType.php @@ -60,6 +60,7 @@ class EntityManagerReturnType implements DynamicMethodReturnTypeExtension private $supportedMethodNameList = [ 'getEntity', 'getNewEntity', + 'getEntityById', 'createEntity', 'getRDBRepository', 'getRepository', @@ -88,7 +89,7 @@ class EntityManagerReturnType implements DynamicMethodReturnTypeExtension $methodName = $methodReflection->getName(); - if ($methodName === 'getEntity') { + if ($methodName === 'getEntity' || $methodName === 'getEntityById') { return $this->getGetEntity($methodReflection, $methodCall, $scope); }