Webmozart\Expression\Expression::evaluate PHP Method

evaluate() public method

Evaluates the expression with the given value.
public evaluate ( mixed $value ) : boolean
$value mixed A value.
return boolean Returns `true` if the value satisfies the expression and `false` otherwise.
    public function evaluate($value);

Usage Example

 protected function hasBindingsWithTypeNameThatMatch($typeName, Expression $expr)
 {
     if (!$this->hasBindingsWithTypeName($typeName)) {
         return false;
     }
     $key = $this->keysByTypeName[$typeName];
     if (!isset($this->bindingsByKey[$key])) {
         $this->loadBindingsForKey($key);
     }
     foreach ($this->bindingsByKey[$key] as $binding) {
         if ($expr->evaluate($binding)) {
             return true;
         }
     }
     return false;
 }
All Usage Examples Of Webmozart\Expression\Expression::evaluate