phpDocInfoFactory = $phpDocInfoFactory; } public function hasClassAnnotation(Class_ $class) : bool { $phpDocInfo = $this->phpDocInfoFactory->createFromNode($class); if (!$phpDocInfo instanceof PhpDocInfo) { return \false; } return $phpDocInfo->hasByAnnotationClasses(self::DOCTRINE_MAPPING_CLASSES); } public function hasClassReflectionAttribute(ClassReflection $classReflection) : bool { /** @var ReflectionClass $nativeReflectionClass */ $nativeReflectionClass = $classReflection->getNativeReflection(); // skip early in case of no attributes at all if ((\method_exists($nativeReflectionClass, 'getAttributes') ? $nativeReflectionClass->getAttributes() : []) === []) { return \false; } foreach (self::DOCTRINE_MAPPING_CLASSES as $doctrineMappingClass) { // skip entities if ((\method_exists($nativeReflectionClass, 'getAttributes') ? $nativeReflectionClass->getAttributes($doctrineMappingClass) : []) !== []) { return \true; } } return \false; } }