From 11ce6a8c039d316da8b3d99eb34c3e838f35fcf1 Mon Sep 17 00:00:00 2001 From: khad Date: Thu, 21 Oct 2021 14:19:00 +0700 Subject: [PATCH] fallback getFileName() to declaring class --- lib/Doctrine/Common/Proxy/ProxyGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/lib/Doctrine/Common/Proxy/ProxyGenerator.php index 550407830..1cd7d79c5 100644 --- a/lib/Doctrine/Common/Proxy/ProxyGenerator.php +++ b/lib/Doctrine/Common/Proxy/ProxyGenerator.php @@ -941,7 +941,7 @@ private function isShortIdentifierGetter($method, ClassMetadata $class) && ($endLine - $startLine <= 4); if ($cheapCheck) { - $code = file($method->getFileName()); + $code = file($method->getFileName() ? $method->getFileName():$method->getDeclaringClass()->getFileName()); $code = trim(implode(' ', array_slice($code, $startLine - 1, $endLine - $startLine + 1))); $pattern = sprintf(self::PATTERN_MATCH_ID_METHOD, $method->getName(), $identifier);