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);