src/Horse/Parsers/MetadataParser.php
protected function extractElements($line)
    {
        $elements = [];
        $buffer   = '';
        $quote    = false;

        foreach (\str_split($line) as $character)
        {
            if (\in_array($character, ['\'', '"']))
            {
                $quote = ! $quote;

                continue;
            }

            if ((':' == $character) and ! $quote)
            {
                $elements[] = $buffer;

                $buffer = '';

                continue;
            }

            $buffer .= $character;
        }

        if ($buffer)
        {
            $elements[] = $buffer;
        }

        return $elements;
    }
protected function extractElements($line)
    {
        $elements = [];
        $buffer   = '';
        $quote    = false;

        foreach (\str_split($line) as $character)
        {
            if (\in_array($character, ['\'', '"']))
            {
                $quote = ! $quote;

                continue;
            }

            if ((':' == $character) and ! $quote)
            {
                $elements[] = $buffer;

                $buffer = '';

                continue;
            }

            $buffer .= $character;
        }

        if ($buffer)
        {
            $elements[] = $buffer;
        }

        return $elements;
    }
protected function extractElements ( $ line ) { $ elements = [ ] ; $ buffer = '' ; $ quote = false ; foreach ( \ str_split ( $ line ) as $ character ) { if ( \ in_array ( $ character , [ '\'' , '"' ] ) ) { $ quote = ! $ quote ; continue ; } if ( ( ':' == $ character ) and ! $ quote ) { $ elements [ ] = $ buffer ; $ buffer = '' ; continue ; } $ buffer .= $ character ; } if ( $ buffer ) { $ elements [ ] = $ buffer ; } return $ elements ; }
Extract an array of elements from the string.

@param string $line
@return array
Extract an array of elements from the string .