public function setVars($variables)
    {
        if (!is_array($variables) && !$variables instanceof ArrayAccess) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Expected array or ArrayAccess object; received "%s"',
                (is_object($variables) ? get_class($variables) : gettype($variables))
            ));
        }

        // Enforce a Variables container
        if (!$variables instanceof Variables) {
            $variablesAsArray = array();
            foreach ($variables as $key => $value) {
                $variablesAsArray[$key] = $value;
            }
            $variables = new Variables($variablesAsArray);
        }

        $this->__vars = $variables;
        return $this;
    }
public function setVars($variables)
    {
        if (!is_array($variables) && !$variables instanceof ArrayAccess) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Expected array or ArrayAccess object; received "%s"',
                (is_object($variables) ? get_class($variables) : gettype($variables))
            ));
        }

        // Enforce a Variables container
        if (!$variables instanceof Variables) {
            $variablesAsArray = array();
            foreach ($variables as $key => $value) {
                $variablesAsArray[$key] = $value;
            }
            $variables = new Variables($variablesAsArray);
        }

        $this->__vars = $variables;
        return $this;
    }
public function setVars ( $ variables ) { if ( ! is_array ( $ variables ) && ! $ variables instanceof ArrayAccess ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Expected array or ArrayAccess object; received "%s"' , ( is_object ( $ variables ) ? get_class ( $ variables ) : gettype ( $ variables ) ) ) ) ; } // Enforce a Variables container if ( ! $ variables instanceof Variables ) { $ variablesAsArray = array ( ) ; foreach ( $ variables as $ key => $ value ) { $ variablesAsArray [ $ key ] = $ value ; } $ variables = new Variables ( $ variablesAsArray ) ; } $ this -> __vars = $ variables ; return $ this ; }
Set variable storage

Expects either an array, or an object implementing ArrayAccess.

@param  array|ArrayAccess $variables
@return PhpRenderer
@throws Exception\InvalidArgumentException
Set variable storage