public function getProxyClass($fullClassName)
{
if (interface_exists($fullClassName) || in_array(BaseTestCase::class, class_parents($fullClassName))) {
return false;
}
if (class_exists($fullClassName) === false) {
return false;
}
$classReflection = new \ReflectionClass($fullClassName);
if ($classReflection->isInternal() === true) {
return false;
}
$proxyAnnotation = $this->reflectionService->getClassAnnotation($fullClassName, Flow\Proxy::class);
if ($proxyAnnotation !== null && $proxyAnnotation->enabled === false) {
return false;
}
if (in_array(substr($fullClassName, 0, $this->blacklistedSubPackagesLength), $this->blacklistedSubPackages)) {
return false;
}
// Annotation classes (like \Neos\Flow\Annotations\Entity) must never be proxied because that would break the Doctrine AnnotationParser
if ($classReflection->isFinal() && preg_match('/^\\s?\\*\\s?\\@Annotation\\s/m', $classReflection->getDocComment()) === 1) {
return false;
}
if (!isset($this->proxyClasses[$fullClassName])) {
$this->proxyClasses[$fullClassName] = new ProxyClass($fullClassName);
$this->proxyClasses[$fullClassName]->injectReflectionService($this->reflectionService);
}
return $this->proxyClasses[$fullClassName];
}