doctrineEntityAnalyzer = $doctrineEntityAnalyzer; $this->reflectionProvider = $reflectionProvider; } public function detect(Class_ $class) : bool { // A. check annotations if ($this->doctrineEntityAnalyzer->hasClassAnnotation($class)) { return \true; } if (!$class->namespacedName instanceof Name) { return \false; } $className = $class->namespacedName->toString(); // B. check attributes $classReflection = $this->reflectionProvider->getClass($className); return $this->doctrineEntityAnalyzer->hasClassReflectionAttribute($classReflection); } }