private function createPoincutExpression(Annotation $annotation)
 {
     $pointcutExpression = new PointcutExpression($annotation->getParameter('value'));
     switch ($annotation->getName()) {
         case Before::class:
             $pointcut = new BeforePointcut($pointcutExpression);
             break;
         case After::class:
             $pointcut = new AfterPointcut($pointcutExpression);
             break;
         case AfterReturning::class:
             $pointcut = new AfterReturningPointcut($pointcutExpression);
             break;
         case AfterThrowing::class:
             $pointcut = new AfterThrowingPointcut($pointcutExpression);
             break;
         case Around::class:
             $pointcut = new AroundPointcut($pointcutExpression);
             break;
         default:
             throw new InvalidArgumentException('Uknown pointcut ' . $annotation->getName());
     }
     return $pointcut;
 }
 /**
  * @param AnnotationExpression $annotationExpression
  * @param Annotation $annotation
  * @return string
  */
 public function match(AnnotationExpression $annotationExpression, Annotation $annotation)
 {
     $regexp = $this->toRegexp($annotationExpression);
     return (bool) preg_match($regexp, $annotation->toExpression());
 }