public function unsetVariable($variable)
    {
        $data = &$this->getDataPlaceHolder();

        if (gettype($variable) === 'string') {
            $variableIdentifier = $variable;
        } elseif ($variable instanceof Variable) {
            $variableIdentifier = $variable->getIdentifier();
        } else {
            $msg = "The variable argument must be a Variable object or a string, '" . $variable . "' given";
            throw new InvalidArgumentException($msg);
        }

        if (isset($data[$variableIdentifier])) {
            unset($data[$variableIdentifier]);
        } else {
            $msg = "No Variable object with identifier '${variableIdentifier}' found in the current State object.";
            throw new OutOfBoundsException($msg);
        }
    }
public function unsetVariable($variable)
    {
        $data = &$this->getDataPlaceHolder();

        if (gettype($variable) === 'string') {
            $variableIdentifier = $variable;
        } elseif ($variable instanceof Variable) {
            $variableIdentifier = $variable->getIdentifier();
        } else {
            $msg = "The variable argument must be a Variable object or a string, '" . $variable . "' given";
            throw new InvalidArgumentException($msg);
        }

        if (isset($data[$variableIdentifier])) {
            unset($data[$variableIdentifier]);
        } else {
            $msg = "No Variable object with identifier '${variableIdentifier}' found in the current State object.";
            throw new OutOfBoundsException($msg);
        }
    }
public function unsetVariable ( $ variable ) { $ data = & $ this -> getDataPlaceHolder ( ) ; if ( gettype ( $ variable ) === 'string' ) { $ variableIdentifier = $ variable ; } elseif ( $ variable instanceof Variable ) { $ variableIdentifier = $ variable -> getIdentifier ( ) ; } else { $ msg = "The variable argument must be a Variable object or a string, '" . $ variable . "' given" ; throw new InvalidArgumentException ( $ msg ) ; } if ( isset ( $ data [ $ variableIdentifier ] ) ) { unset ( $ data [ $ variableIdentifier ] ) ; } else { $ msg = "No Variable object with identifier '${variableIdentifier}' found in the current State object." ; throw new OutOfBoundsException ( $ msg ) ; } }
Unset a variable from the current state. In other words
the relevant Variable object is removed from the state.

@param string|Variable $variable The identifier of the variable or a Variable object to unset.
@throws \InvalidArgumentException If $variable is not a string nor a Variable object.
@throws \OutOfBoundsException If no variable in the current state matches $variable.
Unset a variable from the current state . In other words the relevant Variable object is removed from the state .