public function extract(Parser $parser, Node\Variable $var, $data)
    {
        $value   = $data;
        $vals    = array_filter(explode($this->sep, $data));
        $options = $var->options;

        switch ($options['modifier']) {

            case '*':
                $data = array();
                foreach($vals as $val) {

                    if (strpos($val, '=') !== false) {
                        list($k, $v) = explode('=', $val);
                        $data[$k] = $v;
                    }

                    else {
                        $data[]   = $val;
                    }
                }

                break;
            case ':':
                break;
            default:
                $data = strpos($data, $this->sep) !== false ? $vals : $value;

        }

        return $this->decode($parser, $var, $data);
    }
public function extract(Parser $parser, Node\Variable $var, $data)
    {
        $value   = $data;
        $vals    = array_filter(explode($this->sep, $data));
        $options = $var->options;

        switch ($options['modifier']) {

            case '*':
                $data = array();
                foreach($vals as $val) {

                    if (strpos($val, '=') !== false) {
                        list($k, $v) = explode('=', $val);
                        $data[$k] = $v;
                    }

                    else {
                        $data[]   = $val;
                    }
                }

                break;
            case ':':
                break;
            default:
                $data = strpos($data, $this->sep) !== false ? $vals : $value;

        }

        return $this->decode($parser, $var, $data);
    }
public function extract ( Parser $ parser , Node \ Variable $ var , $ data ) { $ value = $ data ; $ vals = array_filter ( explode ( $ this -> sep , $ data ) ) ; $ options = $ var -> options ; switch ( $ options [ 'modifier' ] ) { case '*' : $ data = array ( ) ; foreach ( $ vals as $ val ) { if ( strpos ( $ val , '=' ) !== false ) { list ( $ k , $ v ) = explode ( '=' , $ val ) ; $ data [ $ k ] = $ v ; } else { $ data [ ] = $ val ; } } break ; case ':' : break ; default : $ data = strpos ( $ data , $ this -> sep ) !== false ? $ vals : $ value ; } return $ this -> decode ( $ parser , $ var , $ data ) ; }
Extracts value from variable

@param  Parser        $parser
@param  Node\Variable $var
@param  string        $data
@return string
Extracts value from variable