Check if class exists.

@param string $class
@param array $classAnnotations
@return void
432067
public function validateEmbeddedClass($class, $classAnnotations)
    {
        $check = false;

        foreach ($classAnnotations as $annotation) {
            if ($annotation instanceof \ProAI\Datamapper\Annotations\Embeddable) {
                $check = true;
            }
        }

        if (! $check) {
            throw new InvalidArgumentException('Embedded class '.$class.' has no @Embeddable annotation.');
        }
    }
960105
public function addClass(PhpClass $class)
    {
        if ($this->classExists($class->getIdentifier())) {
            throw new Exception('A class of the name (' . $class->getIdentifier() . ') does already exist.');
        }

        $this->classes[$class->getIdentifier()] = $class;
    }
364208
public static boolean isAnnotationPresent(Annotation[] annotations,
      Class<? extends Annotation> cls) {
    for (Annotation annotation : annotations) {
      if (cls.isInstance(annotation)) {
        return true;
      }
    }
    return false;
  }
1293680
protected function hasNodeParser(string $class): bool
    {
        if (Validator::key($class, Validator::instance(NodeParserInterface::class))
            ->validate($this->nodeParsers)) {
            return true;
        }
        return false;
    }
345825
protected function assertAnnotationClass(array $annotations)
	{
		if ( !$annotations ) {
			$parameters = array((string)$this->property, $this->property->getDataType());
			$message = '@find-by must be specified in the property "%s" DocBlock or in class "%s" DocBlock';
			throw new AnnotationException(vsprintf($message, $parameters), AnnotationException::TYPE_REQUIRED);
		}

		foreach ( $annotations as $annotation ) {
			if ( !($annotation instanceof FindByAnnotation) ) {
				$parameters = array((string)$this->property, $this->property->getDataType());
				$message = '@find-by must be specified in the property "%s" DocBlock or in class "%s" DocBlock';
				throw new AnnotationException(vsprintf($message, $parameters), AnnotationException::TYPE_REQUIRED);
			}
		}
	}
967703
public function supportsClass($class)
    {
        if($class)
        {
            $classNameArray = explode('\\', $class);
            $className = $classNameArray[ count($classNameArray)-1 ];

            if( in_array($className, array('User', 'AdminVoter')) )
            {
                return true;
            }
        }

        return false;
    }
221133
private function getValidators($annotations, $class)
    {
        $validators = [];
        $it = $this->getAnnotations()->filter($annotations)
            ->is(ValidatorInterface::class)
            ->onProperties();
        foreach ($it as $annotation) {
            $property = $annotation->getPropertyName();
            if (!isset($validators[$property])) {
                $validators[$property] = [
                    'required' => false,
                    'validators' => [],
                ];
            }
            $validators[$property]['validators'][] = $annotation->getValidator($this);
            if ($annotation instanceof Required) {
                $validators[$property]['required'] = true;
            }
        }
        return $validators;
    }
1079187
private function _isClassInList($class, $classes)
    {
        $items = explode(" ", trim($classes));
        if (count($items) > 0) {
            foreach ($items as $item) {
                if (strcasecmp($class, trim($item)) == 0) {
                    return true;
                }
            }
        }
        return false;
    }
1060065
private static boolean checkAnnoExist(Object targetClass, Class<?> annoClass) {
		Annotation[] anno = getAnnotations(targetClass);
		for (Annotation annotation : anno) {
			Class<? extends Annotation> type = annotation.annotationType();
			if (annoClass.equals(type))
				return true;
		}
		return false;
	}
521194
private function isParseExtendAnnotations(array $annotations, int $type = 1): bool
    {
        foreach ($this->extends as $extend) {
            if ($type == 1) {
                $isParse = $extend->isParseClassAnnotations($annotations);
            } elseif ($type == 2) {
                $isParse = $extend->isParsePropertyAnnotations($annotations);
            } else {
                $isParse = $extend->isParseMethodAnnotations($annotations);
            }
            if ($isParse) {
                return true;
            }
        }

        return false;
    }
648014
public function parseClassAnnotations(string $className, array $annotations)
    {
        if (!$this->isParseClass($annotations)) {
            return null;
        }

        $beanData = null;
        foreach ($annotations as $annotation) {
            $annotationClass = get_class($annotation);
            if (!in_array($annotationClass, $this->getClassAnnotations())) {
                continue;
            }

            // annotation parser
            $annotationParser = $this->getAnnotationParser($annotation);
            if ($annotationParser == null) {
                continue;
            }
            $annotationData = $annotationParser->parser($className, $annotation);
            if ($annotationData != null) {
                $beanData = $annotationData;
            }
        }

        return $beanData;
    }
83364
protected function evaluateEntityListenersAnnotation(\ReflectionClass $class, ORM\ClassMetadata $metadata, array $classAnnotations)
    {
        if (isset($classAnnotations[ORM\EntityListeners::class])) {
            $entityListenersAnnotation = $classAnnotations[ORM\EntityListeners::class];

            foreach ($entityListenersAnnotation->value as $item) {
                $listenerClassName = $metadata->fullyQualifiedClassName($item);

                if (!class_exists($listenerClassName)) {
                    throw ORM\MappingException::entityListenerClassNotFound($listenerClassName, $class->getName());
                }

                $hasMapping = false;
                foreach ($class->getMethods() as $method) {
                    if ($method->isPublic()) {
                        // find method callbacks.
                        $callbacks = $this->getMethodCallbacks($method);
                        $hasMapping = $hasMapping ?: (!empty($callbacks));

                        foreach ($callbacks as $value) {
                            $metadata->addEntityListener($value[1], $listenerClassName, $value[0]);
                        }
                    }
                }

                // Evaluate the listener using naming convention.
                if ($hasMapping === false) {
                    EntityListenerBuilder::bindEntityListener($metadata, $listenerClassName);
                }
            }
        }
    }
515267
private void checkInnerClass(ClassDeclaration jclass)
            throws FatalCompileTimeException
    {
        boolean noFormBeanAnnotation = true;
        if (CompilerUtils.getAnnotation(jclass, FORM_BEAN_TAG_NAME, true) != null) {
            noFormBeanAnnotation = false;
        }
        else {
            //
            // check the methods for validatable property annotations that
            // would be processed elsewhere.
            //
            MethodDeclaration[] methods = CompilerUtils.getClassMethods(jclass, null);
            for (int i = 0; i < methods.length && noFormBeanAnnotation; i++) {
                MethodDeclaration method = methods[i];
                if (CompilerUtils.getAnnotation(method, VALIDATABLE_PROPERTY_TAG_NAME) != null) {
                    noFormBeanAnnotation = false;
                }
            }
        }

        if (noFormBeanAnnotation) {
            _formBeanChecker.check(jclass);
        }
    }
1359299
public function autoload($class) {
        $classKey = strtolower($class);

        if (isset($this->classes[$classKey])) {
            list($_, $path) = $this->classes[$classKey];
            include_once $path;
        }
    }
934214
public function AddClass(
        \Peg\Lib\Definitions\Element\ClassElement $class, 
        $namespace = "\\"
    )
    {
        $this->CreateNamespace($namespace);
        
        $class->header =& $this;
        $class->namespace =& $this->namespaces[$namespace];

        $this->namespaces[$namespace]
            ->classes[$class->name] = $class
        ;
    }
1105250
@SuppressWarnings("unchecked")
    @SafeVarargs
    public final boolean containsAnnotations(Class<? extends Annotation>... annotationClass) {
        if (ArrayUtils.isEmpty(annotationClass)) {
            return false;
        }

        for (Object anno : getAnnotations()) {
            for (Class cls : annotationClass) {
                if (((Annotation) anno).annotationType().equals(cls)) {
                    return true;
                }
            }
        }
        return false;
    }
180599
public function loadClass($class)
    {
        foreach (spl_autoload_functions() as $func) {
            if (is_array($func) && $func[0] === $this) {
                continue;
            }
            $this->classList->push($class);
            if (call_user_func($func, $class)) {
                break;
            }
        }

        $this->classList->next();

        return true;
    }