public function addVariable($key, $value)
    {
        if (is_null($key) || ! is_string($key)) {
            throw new RuntimeException(sprintf('The key where to save your variable in the expression context is invalid. Got "%s".', $key));
        }

        $this->variables[$key] = $value;
    }
public function addVariable($key, $value)
    {
        if (is_null($key) || ! is_string($key)) {
            throw new RuntimeException(sprintf('The key where to save your variable in the expression context is invalid. Got "%s".', $key));
        }

        $this->variables[$key] = $value;
    }
public function addVariable ( $ key , $ value ) { if ( is_null ( $ key ) || ! is_string ( $ key ) ) { throw new RuntimeException ( sprintf ( 'The key where to save your variable in the expression context is invalid. Got "%s".' , $ key ) ) ; } $ this -> variables [ $ key ] = $ value ; }
Add a variable in the context.

@param string $key A key to store the variable.
@param mixed $value The variable to store.
Add a variable in the context .