src/Command/StatsTrait.php
protected function decode($response)
    {
        $lines = array_slice(explode("\n", trim($response)), 1);

        $result = [];
        foreach ($lines as $line) {
            if ($line[0] == '-') {
                $result[] = trim(ltrim($line, '- '));
            } else {
                $key = strtok($line, ': ');
                if ($key) {
                    $value = ltrim(trim(strtok('')), ' ');

                    if (is_numeric($value)) {
                        $value = $value + 0;
                    }

                    $result[$key] = $value;
                }
            }
        }

        return $result;
    }
protected function decode($response)
    {
        $lines = array_slice(explode("\n", trim($response)), 1);

        $result = [];
        foreach ($lines as $line) {
            if ($line[0] == '-') {
                $result[] = trim(ltrim($line, '- '));
            } else {
                $key = strtok($line, ': ');
                if ($key) {
                    $value = ltrim(trim(strtok('')), ' ');

                    if (is_numeric($value)) {
                        $value = $value + 0;
                    }

                    $result[$key] = $value;
                }
            }
        }

        return $result;
    }
protected function decode ( $ response ) { $ lines = array_slice ( explode ( "\n" , trim ( $ response ) ) , 1 ) ; $ result = [ ] ; foreach ( $ lines as $ line ) { if ( $ line [ 0 ] == '-' ) { $ result [ ] = trim ( ltrim ( $ line , '- ' ) ) ; } else { $ key = strtok ( $ line , ': ' ) ; if ( $ key ) { $ value = ltrim ( trim ( strtok ( '' ) ) , ' ' ) ; if ( is_numeric ( $ value ) ) { $ value = $ value + 0 ; } $ result [ $ key ] = $ value ; } } } return $ result ; }
Decodes the YAML string into an array of data.

@param  string $response
@return array
Decodes the YAML string into an array of data .