/**
  * {@inheritdoc}
  */
 public function getAdvice()
 {
     $advice = parent::getAdvice();
     if ($this->pointcut->getKind() & PointFilter::KIND_DYNAMIC) {
         $advice = new DynamicInvocationMatcherInterceptor($this->pointcut, $advice);
     }
     return $advice;
 }
示例#2
0
 /**
  * Signature method matcher constructor
  *
  * @param Pointcut $first First filter
  * @param Pointcut $second Second filter
  */
 public function __construct(Pointcut $first, Pointcut $second)
 {
     $this->first = $first;
     $this->second = $second;
     $this->kind = $first->getKind() | $second->getKind();
     $this->classFilter = new OrPointFilter($first->getClassFilter(), $second->getClassFilter());
 }
示例#3
0
 /**
  * @inheritDoc
  */
 protected function matchPart(Pointcut $pointcut, $point, $context = null, $instance = null, array $arguments = null)
 {
     $pointcutKind = $pointcut->getKind();
     // We need to recheck filter kind one more time, because of OR syntax
     switch (true) {
         case $point instanceof \ReflectionMethod && $pointcutKind & PointFilter::KIND_METHOD:
         case $point instanceof \ReflectionProperty && $pointcutKind & PointFilter::KIND_PROPERTY:
         case $point instanceof \ReflectionClass && $pointcutKind & PointFilter::KIND_CLASS:
             return parent::matchPart($pointcut, $point, $context, $instance, $arguments);
         default:
             return false;
     }
 }
示例#4
0
 /**
  * Inverse pointcut matcher
  *
  * @param Pointcut $pointcut Pointcut expression
  */
 public function __construct(Pointcut $pointcut)
 {
     $this->pointcut = $pointcut;
     $this->kind = $pointcut->getKind();
 }