/** * Performs matching of point of code * * @param mixed $point Specific part of code, can be any Reflection class * @param null|mixed $context Related context, can be class or namespace * @param null|string|object $instance Invocation instance or string for static calls * @param null|array $arguments Dynamic arguments for method * * @return bool */ public function matches($point, $context = null, $instance = null, array $arguments = null) { $isMatchesPre = $this->pointcut->getClassFilter()->matches($context); if (!$isMatchesPre) { return true; } $isMatchesPoint = $this->pointcut->matches($point, $context, $instance, $arguments); if (!$isMatchesPoint) { return true; } return false; }
/** * Performs matching of point of code * * @param mixed $point Specific part of code, can be any Reflection class * * @return bool */ public function matches($point) { $preFilter = method_exists($point, 'getDeclaringClass') ? $point->getDeclaringClass() : $point->getNamespaceName(); $isMatchesPre = $this->pointcut->getClassFilter()->matches($preFilter); if (!$isMatchesPre) { return true; } $isMatchesPoint = $this->pointcut->matches($point); if (!$isMatchesPoint) { return true; } return false; }
/** * Checks if point filter matches the point * * @param \ReflectionMethod|\ReflectionProperty $point * @param Pointcut $pointcut Pointcut part * * @return bool */ protected function isMatchesPointcut($point, Pointcut $pointcut) { $preFilter = method_exists($point, 'getDeclaringClass') ? $point->getDeclaringClass() : $point->getNamespaceName(); return $pointcut->matches($point) && $pointcut->getClassFilter()->matches($preFilter); }
/** * Checks if point filter matches the point * * @param \ReflectionMethod|\ReflectionProperty $point * @param Pointcut $pointcut Pointcut part * @param object|string|null $instance [Optional] Instance for dynamic matching * @param array $arguments [Optional] Extra arguments for dynamic matching * * @return bool */ protected function isMatchesPointcut($point, Pointcut $pointcut, $instance = null, array $arguments = null) { $preFilter = method_exists($point, 'getDeclaringClass') ? $point->getDeclaringClass() : $point->getNamespaceName(); return $pointcut->matches($point, $instance, $arguments) && $pointcut->getClassFilter()->matches($preFilter); }
/** * Checks if point filter matches the point * * @param Pointcut $pointcut Pointcut part * @param \ReflectionMethod|\ReflectionProperty $point * @param mixed $context Related context, can be class or namespace * @param object|string|null $instance [Optional] Instance for dynamic matching * @param array $arguments [Optional] Extra arguments for dynamic matching * * @return bool */ protected function matchPart(Pointcut $pointcut, $point, $context = null, $instance = null, array $arguments = null) { return $pointcut->matches($point, $context, $instance, $arguments) && $pointcut->getClassFilter()->matches($context); }