src/Data/Content.php
public function from($type)
    {
        switch ($type) {
            case 'ini':
                $this->data = Ini::decode($this->string);
                break;

            case 'json':
                $this->data = Json::decode($this->string);
                break;

            case 'php':
                $this->data = Php::decode($this->string);
                break;

            case 'xml':
                $this->data = Xml::decode($this->string);
                break;

            case 'yml':
            case 'yaml':
                $this->data = Yaml::decode($this->string);
                break;
            
            default:
                throw new \Exception("Format not supported: " . $type);
        }

        return $this;
    }
public function from($type)
    {
        switch ($type) {
            case 'ini':
                $this->data = Ini::decode($this->string);
                break;

            case 'json':
                $this->data = Json::decode($this->string);
                break;

            case 'php':
                $this->data = Php::decode($this->string);
                break;

            case 'xml':
                $this->data = Xml::decode($this->string);
                break;

            case 'yml':
            case 'yaml':
                $this->data = Yaml::decode($this->string);
                break;
            
            default:
                throw new \Exception("Format not supported: " . $type);
        }

        return $this;
    }
public function from ( $ type ) { switch ( $ type ) { case 'ini' : $ this -> data = Ini :: decode ( $ this -> string ) ; break ; case 'json' : $ this -> data = Json :: decode ( $ this -> string ) ; break ; case 'php' : $ this -> data = Php :: decode ( $ this -> string ) ; break ; case 'xml' : $ this -> data = Xml :: decode ( $ this -> string ) ; break ; case 'yml' : case 'yaml' : $ this -> data = Yaml :: decode ( $ this -> string ) ; break ; default : throw new \ Exception ( "Format not supported: " . $ type ) ; } return $ this ; }
Specifies the structure type which the content will be parsed from
@param  string $type Type [ini, json, php, xml or yaml]
@return Content
Specifies the structure type which the content will be parsed from