Neos\Flow\Aop\Pointcut\PointcutSettingFilter::matches PHP Method

matches() public method

Checks if the specified configuration option is set to TRUE or FALSE, or if it matches the specified condition
public matches ( string $className, string $methodName, string $methodDeclaringClassName, mixed $pointcutQueryIdentifier ) : boolean
$className string Name of the class to check against
$methodName string Name of the method - not used here
$methodDeclaringClassName string Name of the class the method was originally declared in - not used here
$pointcutQueryIdentifier mixed Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection.
return boolean TRUE if the class matches, otherwise FALSE
    public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier)
    {
        if ($this->cachedResult === null) {
            $this->cachedResult = is_bool($this->actualSettingValue) ? $this->actualSettingValue : $this->condition === $this->actualSettingValue;
        }
        return $this->cachedResult;
    }

Usage Example

 /**
  * @test
  */
 public function filterDoesNotMatchOnAFalseCondition()
 {
     $mockConfigurationManager = $this->getMockBuilder(ConfigurationManager::class)->disableOriginalConstructor()->getMock();
     $settings['foo']['bar']['baz']['value'] = 'some other value';
     $mockConfigurationManager->expects($this->atLeastOnce())->method('getConfiguration')->with(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'package')->will($this->returnValue($settings));
     $filter = new Aop\Pointcut\PointcutSettingFilter('package.foo.bar.baz.value = \'some value\'');
     $filter->injectConfigurationManager($mockConfigurationManager);
     $this->assertFalse($filter->matches('', '', '', 1));
 }