Neos\Flow\Aop\Builder\ProxyClassBuilder::findPointcut PHP Метод

findPointcut() публичный Метод

Traverses the aspect containers to find a pointcut from the aspect class name and pointcut method name
public findPointcut ( string $aspectClassName, string $pointcutMethodName ) : mixed
$aspectClassName string Name of the aspect class where the pointcut has been declared
$pointcutMethodName string Method name of the pointcut
Результат mixed The Aop\Pointcut\Pointcut or FALSE if none was found
    public function findPointcut($aspectClassName, $pointcutMethodName)
    {
        if (!isset($this->aspectContainers[$aspectClassName])) {
            return false;
        }
        foreach ($this->aspectContainers[$aspectClassName]->getPointcuts() as $pointcut) {
            if ($pointcut->getPointcutMethodName() === $pointcutMethodName) {
                return $pointcut;
            }
        }
        return false;
    }

Usage Example

 /**
  * This method is used to optimize the matching process.
  *
  * @param ClassNameIndex $classNameIndex
  * @return ClassNameIndex
  */
 public function reduceTargetClassNames(ClassNameIndex $classNameIndex)
 {
     if ($this->pointcut === null) {
         $this->pointcut = $this->proxyClassBuilder->findPointcut($this->aspectClassName, $this->pointcutMethodName);
     }
     if ($this->pointcut === false) {
         return $classNameIndex;
     }
     return $this->pointcut->reduceTargetClassNames($classNameIndex);
 }