public function execute(Context $context)
    {
        if ($this->evaluate($context) && isset($this->action)) {
            if (!is_callable($this->action)) {
                throw new \LogicException('Rule actions must be callable.');
            }

            call_user_func($this->action);
        }
    }
public function execute(Context $context)
    {
        if ($this->evaluate($context) && isset($this->action)) {
            if (!is_callable($this->action)) {
                throw new \LogicException('Rule actions must be callable.');
            }

            call_user_func($this->action);
        }
    }
public function execute ( Context $ context ) { if ( $ this -> evaluate ( $ context ) && isset ( $ this -> action ) ) { if ( ! is_callable ( $ this -> action ) ) { throw new \ LogicException ( 'Rule actions must be callable.' ) ; } call_user_func ( $ this -> action ) ; } }
Execute the Rule with the given Context.

The Rule will be evaluated, and if successful, will execute its
$action callback.

@param  Context         $context Context with which to execute this Rule
@throws \LogicException
Execute the Rule with the given Context .