/** * * @param string $class * @param array $config * @return ClassAnnotationHolder */ public function parse($class, array $config = array()) { $annotationManager = new AnnotationManager(); $parser = new DoctrineAnnotationParser(); $parser->registerAnnotation(Route::class); $parser->registerAnnotation(Service::class); $parser->registerAnnotation(Controller::class); $parser->registerAnnotation(ControllerPlugin::class); $parser->registerAnnotation(Filter::class); $parser->registerAnnotation(FormElement::class); $parser->registerAnnotation(Hydrator::class); $parser->registerAnnotation(InputFilter::class); $parser->registerAnnotation(LogProcessor::class); $parser->registerAnnotation(LogWriter::class); $parser->registerAnnotation(Route::class); $parser->registerAnnotation(RoutePlugin::class); $parser->registerAnnotation(Serializer::class); $parser->registerAnnotation(Validator::class); $parser->registerAnnotation(ViewHelper::class); $annotationManager->attach($parser); $scanner = new DirectoryScanner('.'); $class = $scanner->getClass($class); $eventManager = new EventManager(); $parser = new ClassParser($config, $annotationManager, $eventManager); return $this->handleClassAnnotations($parser->parseClass($class), $config); }
/** * * @param string $class * @param array $config * @return ClassAnnotationHolder */ public function parse($class, array $config = array()) { $annotationReader = AnnotationReaderFactory::factory(['annotations' => [], 'cache' => null, 'cache_debug' => false, 'ignored_annotations' => ['events'], 'namespaces' => ['ZfAnnotation\\Annotation' => __DIR__ . '/../../src']]); $eventManager = new EventManager(); $parser = new ClassParser($config, $annotationReader, $eventManager); return $this->handleClassAnnotations($parser->parseClass($class), $config); }