/** * @param ServiceDefinition $service * @throws \Kdyby\Aop\InvalidAspectExceptions * @return array|Filter[] */ public function analyze(ServiceDefinition $service) { $pointcuts = []; foreach ($service->getOpenMethods() as $method) { if (!($annotations = $this->filterAopAnnotations($method->getAnnotations($this->annotationReader)))) { continue; } $rules = []; foreach ($annotations as $annotation) { $rules[get_class($annotation)] = $this->pointcutParser->parse($annotation->value); } $pointcuts[$method->getName()] = $rules; } if (empty($pointcuts)) { throw new InvalidAspectExceptions("The aspect {$service->typeReflection} has no pointcuts defined."); } return $pointcuts; }
/** * @param Reader $reader * @return array|object[] */ public function getClassAnnotations(Reader $reader) { return $reader->getClassAnnotations($this->serviceDefinition->getTypeReflection()); }