public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier): bool
    {
        $this->runtimeEvaluationsDefinition = [];
        $matches = true;
        foreach ($this->filters as &$operatorAndFilter) {
            list($operator, $filter) = $operatorAndFilter;

            $currentFilterMatches = $filter->matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier);
            $currentRuntimeEvaluationsDefinition = $filter->getRuntimeEvaluationsDefinition();

            switch ($operator) {
                case '&&':
                    if ($currentFilterMatches === true && $filter->hasRuntimeEvaluationsDefinition()) {
                        if (!isset($this->runtimeEvaluationsDefinition[$operator])) {
                            $this->runtimeEvaluationsDefinition[$operator] = [];
                        }
                        $this->runtimeEvaluationsDefinition[$operator] = array_merge_recursive($this->runtimeEvaluationsDefinition[$operator], $currentRuntimeEvaluationsDefinition);
                    }
                    if ($this->earlyReturn && !$currentFilterMatches) {
                        return false;
                    }
                    $matches = $matches && $currentFilterMatches;
                break;
                case '&&!':
                    if ($currentFilterMatches === true && $filter->hasRuntimeEvaluationsDefinition()) {
                        if (!isset($this->runtimeEvaluationsDefinition[$operator])) {
                            $this->runtimeEvaluationsDefinition[$operator] = [];
                        }
                        $this->runtimeEvaluationsDefinition[$operator] = array_merge_recursive($this->runtimeEvaluationsDefinition[$operator], $currentRuntimeEvaluationsDefinition);
                        $currentFilterMatches = false;
                    }
                    if ($this->earlyReturn && $currentFilterMatches) {
                        return false;
                    }
                    $matches = $matches && (!$currentFilterMatches);
                break;
                case '||':
                    if ($currentFilterMatches === true && $filter->hasRuntimeEvaluationsDefinition()) {
                        if (!isset($this->runtimeEvaluationsDefinition[$operator])) {
                            $this->runtimeEvaluationsDefinition[$operator] = [];
                        }
                        $this->runtimeEvaluationsDefinition[$operator] = array_merge_recursive($this->runtimeEvaluationsDefinition[$operator], $currentRuntimeEvaluationsDefinition);
                    }
                    $matches = $matches || $currentFilterMatches;
                break;
                case '||!':
                    if ($currentFilterMatches === true && $filter->hasRuntimeEvaluationsDefinition()) {
                        if (!isset($this->runtimeEvaluationsDefinition[$operator])) {
                            $this->runtimeEvaluationsDefinition[$operator] = [];
                        }
                        $this->runtimeEvaluationsDefinition[$operator] = array_merge_recursive($this->runtimeEvaluationsDefinition[$operator], $currentRuntimeEvaluationsDefinition);
                        $currentFilterMatches = false;
                    }
                    $matches = $matches || (!$currentFilterMatches);
                break;
            }
        }

        return $matches;
    }
public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier): bool
    {
        $this->runtimeEvaluationsDefinition = [];
        $matches = true;
        foreach ($this->filters as &$operatorAndFilter) {
            list($operator, $filter) = $operatorAndFilter;

            $currentFilterMatches = $filter->matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier);
            $currentRuntimeEvaluationsDefinition = $filter->getRuntimeEvaluationsDefinition();

            switch ($operator) {
                case '&&':
                    if ($currentFilterMatches === true && $filter->hasRuntimeEvaluationsDefinition()) {
                        if (!isset($this->runtimeEvaluationsDefinition[$operator])) {
                            $this->runtimeEvaluationsDefinition[$operator] = [];
                        }
                        $this->runtimeEvaluationsDefinition[$operator] = array_merge_recursive($this->runtimeEvaluationsDefinition[$operator], $currentRuntimeEvaluationsDefinition);
                    }
                    if ($this->earlyReturn && !$currentFilterMatches) {
                        return false;
                    }
                    $matches = $matches && $currentFilterMatches;
                break;
                case '&&!':
                    if ($currentFilterMatches === true && $filter->hasRuntimeEvaluationsDefinition()) {
                        if (!isset($this->runtimeEvaluationsDefinition[$operator])) {
                            $this->runtimeEvaluationsDefinition[$operator] = [];
                        }
                        $this->runtimeEvaluationsDefinition[$operator] = array_merge_recursive($this->runtimeEvaluationsDefinition[$operator], $currentRuntimeEvaluationsDefinition);
                        $currentFilterMatches = false;
                    }
                    if ($this->earlyReturn && $currentFilterMatches) {
                        return false;
                    }
                    $matches = $matches && (!$currentFilterMatches);
                break;
                case '||':
                    if ($currentFilterMatches === true && $filter->hasRuntimeEvaluationsDefinition()) {
                        if (!isset($this->runtimeEvaluationsDefinition[$operator])) {
                            $this->runtimeEvaluationsDefinition[$operator] = [];
                        }
                        $this->runtimeEvaluationsDefinition[$operator] = array_merge_recursive($this->runtimeEvaluationsDefinition[$operator], $currentRuntimeEvaluationsDefinition);
                    }
                    $matches = $matches || $currentFilterMatches;
                break;
                case '||!':
                    if ($currentFilterMatches === true && $filter->hasRuntimeEvaluationsDefinition()) {
                        if (!isset($this->runtimeEvaluationsDefinition[$operator])) {
                            $this->runtimeEvaluationsDefinition[$operator] = [];
                        }
                        $this->runtimeEvaluationsDefinition[$operator] = array_merge_recursive($this->runtimeEvaluationsDefinition[$operator], $currentRuntimeEvaluationsDefinition);
                        $currentFilterMatches = false;
                    }
                    $matches = $matches || (!$currentFilterMatches);
                break;
            }
        }

        return $matches;
    }
public function matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) : bool { $ this -> runtimeEvaluationsDefinition = [ ] ; $ matches = true ; foreach ( $ this -> filters as & $ operatorAndFilter ) { list ( $ operator , $ filter ) = $ operatorAndFilter ; $ currentFilterMatches = $ filter -> matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) ; $ currentRuntimeEvaluationsDefinition = $ filter -> getRuntimeEvaluationsDefinition ( ) ; switch ( $ operator ) { case '&&' : if ( $ currentFilterMatches === true && $ filter -> hasRuntimeEvaluationsDefinition ( ) ) { if ( ! isset ( $ this -> runtimeEvaluationsDefinition [ $ operator ] ) ) { $ this -> runtimeEvaluationsDefinition [ $ operator ] = [ ] ; } $ this -> runtimeEvaluationsDefinition [ $ operator ] = array_merge_recursive ( $ this -> runtimeEvaluationsDefinition [ $ operator ] , $ currentRuntimeEvaluationsDefinition ) ; } if ( $ this -> earlyReturn && ! $ currentFilterMatches ) { return false ; } $ matches = $ matches && $ currentFilterMatches ; break ; case '&&!' : if ( $ currentFilterMatches === true && $ filter -> hasRuntimeEvaluationsDefinition ( ) ) { if ( ! isset ( $ this -> runtimeEvaluationsDefinition [ $ operator ] ) ) { $ this -> runtimeEvaluationsDefinition [ $ operator ] = [ ] ; } $ this -> runtimeEvaluationsDefinition [ $ operator ] = array_merge_recursive ( $ this -> runtimeEvaluationsDefinition [ $ operator ] , $ currentRuntimeEvaluationsDefinition ) ; $ currentFilterMatches = false ; } if ( $ this -> earlyReturn && $ currentFilterMatches ) { return false ; } $ matches = $ matches && ( ! $ currentFilterMatches ) ; break ; case '||' : if ( $ currentFilterMatches === true && $ filter -> hasRuntimeEvaluationsDefinition ( ) ) { if ( ! isset ( $ this -> runtimeEvaluationsDefinition [ $ operator ] ) ) { $ this -> runtimeEvaluationsDefinition [ $ operator ] = [ ] ; } $ this -> runtimeEvaluationsDefinition [ $ operator ] = array_merge_recursive ( $ this -> runtimeEvaluationsDefinition [ $ operator ] , $ currentRuntimeEvaluationsDefinition ) ; } $ matches = $ matches || $ currentFilterMatches ; break ; case '||!' : if ( $ currentFilterMatches === true && $ filter -> hasRuntimeEvaluationsDefinition ( ) ) { if ( ! isset ( $ this -> runtimeEvaluationsDefinition [ $ operator ] ) ) { $ this -> runtimeEvaluationsDefinition [ $ operator ] = [ ] ; } $ this -> runtimeEvaluationsDefinition [ $ operator ] = array_merge_recursive ( $ this -> runtimeEvaluationsDefinition [ $ operator ] , $ currentRuntimeEvaluationsDefinition ) ; $ currentFilterMatches = false ; } $ matches = $ matches || ( ! $ currentFilterMatches ) ; break ; } } return $ matches ; }
Checks if the specified class and method match the registered class-
and method filter patterns.

@param string $className Name of the class to check against
@param string $methodName Name of the method to check against
@param string $methodDeclaringClassName Name of the class the method was originally declared in
@param mixed $pointcutQueryIdentifier Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection.
@return boolean true if class and method match the pattern, otherwise false
Checks if the specified class and method match the registered class - and method filter patterns .