Webmozart\Expression\Selector\Method::evaluate PHP Метод

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

public evaluate ( $value )
    public function evaluate($value)
    {
        if (!is_object($value)) {
            return false;
        }
        if (!method_exists($value, $this->methodName)) {
            return false;
        }
        return $this->expr->evaluate(call_user_func_array(array($value, $this->methodName), $this->arguments));
    }

Usage Example

Пример #1
0
 public function testEvaluateWithArguments()
 {
     $expr = new Method('getBar', array(2), new GreaterThan(10));
     $this->assertTrue($expr->evaluate(new MethodTest_TestClass(9)));
     $this->assertFalse($expr->evaluate(new MethodTest_TestClass(7)));
 }