src/ExtDirect/Annotations/Parser.php
protected function processClass($class)
    {
        if (!class_exists('\\' . $class)) {
            throw new ExtDirectException(" '{$class}' does not exist!");
        }

        $annotationReader = new AnnotationReader();
        AnnotationRegistry::registerLoader('class_exists');

        $reflectionClass = new ReflectionClass($class);
        $classAnnotation = $annotationReader->getClassAnnotation($reflectionClass, 'ExtDirect\Annotations\Direct');

        if ($classAnnotation instanceof \ExtDirect\Annotations\Direct) {
            $classAnnotation->setClassName($class);

            $methodCollection = new RemotableCollection();
            foreach ($reflectionClass->getMethods() as $reflectionMethod) {
                $methodAnnotation = $annotationReader->getMethodAnnotation($reflectionMethod, 'ExtDirect\Annotations\Remotable');

                if ($methodAnnotation instanceof \ExtDirect\Annotations\Remotable) {
                    $methodAnnotation->setMethodName($reflectionMethod->getName());
                    $methodCollection->add($methodAnnotation);
                }
            }

            $classAnnotation->setMethods($methodCollection);

            return $classAnnotation;
        }
        return false;
    }
protected function processClass($class)
    {
        if (!class_exists('\\' . $class)) {
            throw new ExtDirectException(" '{$class}' does not exist!");
        }

        $annotationReader = new AnnotationReader();
        AnnotationRegistry::registerLoader('class_exists');

        $reflectionClass = new ReflectionClass($class);
        $classAnnotation = $annotationReader->getClassAnnotation($reflectionClass, 'ExtDirect\Annotations\Direct');

        if ($classAnnotation instanceof \ExtDirect\Annotations\Direct) {
            $classAnnotation->setClassName($class);

            $methodCollection = new RemotableCollection();
            foreach ($reflectionClass->getMethods() as $reflectionMethod) {
                $methodAnnotation = $annotationReader->getMethodAnnotation($reflectionMethod, 'ExtDirect\Annotations\Remotable');

                if ($methodAnnotation instanceof \ExtDirect\Annotations\Remotable) {
                    $methodAnnotation->setMethodName($reflectionMethod->getName());
                    $methodCollection->add($methodAnnotation);
                }
            }

            $classAnnotation->setMethods($methodCollection);

            return $classAnnotation;
        }
        return false;
    }
checks if given class should be remotable

@param string $class the class name to check

@return bool|ClassInterface
@throws ExtDirectException