示例#1
0
 public function matches(InfoInterface $info)
 {
     foreach ($info->getAnnotationCandidates() as $anno) {
         if (preg_match($this->annotationRegex, $anno)) {
             return new PointcutMatch();
         }
     }
 }
示例#2
0
 public function matches(TypeInfoManagerInterface $manager, TypeInfoInterface $type, InfoInterface $point = NULL, $read = true)
 {
     if (!$point instanceof MethodInfoInterface) {
         return;
     }
     if ($this->visibility != 0) {
         $matched = false;
         if ($this->visibility & MetaInfo::IS_PUBLIC) {
             $matched = $matched || $point->isPublic();
         }
         if ($this->visibility & MetaInfo::IS_PROTECTED) {
             $matched = $matched || $point->isProtected();
         }
         if ($this->visibility & MetaInfo::IS_PRIVATE) {
             $matched = $matched || $point->isPrivate();
         }
         if (!$matched) {
             return;
         }
     }
     if (!preg_match($this->nameRegex, $point->getName())) {
         return;
     }
     $match = $this->matchesAnnotations($point);
     if ($match === NULL) {
         return;
     }
     if ($this->typeMatcher !== NULL) {
         $sub = $this->typeMatcher->matches($manager, $type, $point, $read);
         if ($sub === NULL) {
             return;
         }
         $match->mergeWith($sub);
     }
     foreach ($this->args as $k => $v) {
         $match->exposeArgument($k, $v);
     }
     return $match;
 }