Go\Aop\Support\OrPointFilter::matches PHP Method

matches() public method

Performs matching of point of code
public matches ( mixed $point, null | mixed $context = null, null | string | object $instance = null, array $arguments = null ) : boolean
$point mixed Specific part of code, can be any Reflection class
$context null | mixed Related context, can be class or namespace
$instance null | string | object Invocation instance or string for static calls
$arguments array Dynamic arguments for method
return boolean
    public function matches($point, $context = null, $instance = null, array $arguments = null)
    {
        return $this->first->matches($point, $context) || $this->second->matches($point, $context);
    }

Usage Example

Beispiel #1
0
 /**
  * @dataProvider logicCases
  */
 public function testMatches(PointFilter $first, PointFilter $second, $expected)
 {
     $filter = new OrPointFilter($first, $second);
     $result = $filter->matches(new \ReflectionClass(__CLASS__));
     $this->assertSame($expected, $result);
 }