protected function parseOutput(string $output): array
    {
        $lines = explode(PHP_EOL, $output);
        $issues = [];
        $lineNo = 1;
        foreach ($lines as $line) {
            $line = trim($line);
            if ('' === $line) {
                // Go to the next line
                $lineNo++;
                continue;
            }
            switch ($line[0]) {
                case '#':
                    $parts = explode(' ', $line);
                    $word = $parts[1];
                    $issue = new Issue($word);
                    $issue->line = $lineNo;
                    $issue->offset = trim($parts[2]);
                    $issues [] = $issue;
                    break;
                case '&':
                    $parts = explode(':', $line);
                    $parts[0] = explode(' ', $parts[0]);
                    $parts[1] = explode(', ', trim($parts[1]));
                    $word = $parts[0][1];
                    $issue = new Issue($word);
                    $issue->line = $lineNo;
                    $issue->offset = trim($parts[0][3]);
                    $issue->suggestions = $parts[1];
                    $issues [] = $issue;
                    break;
            }
        }

        return $issues;
    }
protected function parseOutput(string $output): array
    {
        $lines = explode(PHP_EOL, $output);
        $issues = [];
        $lineNo = 1;
        foreach ($lines as $line) {
            $line = trim($line);
            if ('' === $line) {
                // Go to the next line
                $lineNo++;
                continue;
            }
            switch ($line[0]) {
                case '#':
                    $parts = explode(' ', $line);
                    $word = $parts[1];
                    $issue = new Issue($word);
                    $issue->line = $lineNo;
                    $issue->offset = trim($parts[2]);
                    $issues [] = $issue;
                    break;
                case '&':
                    $parts = explode(':', $line);
                    $parts[0] = explode(' ', $parts[0]);
                    $parts[1] = explode(', ', trim($parts[1]));
                    $word = $parts[0][1];
                    $issue = new Issue($word);
                    $issue->line = $lineNo;
                    $issue->offset = trim($parts[0][3]);
                    $issue->suggestions = $parts[1];
                    $issues [] = $issue;
                    break;
            }
        }

        return $issues;
    }
protected function parseOutput ( string $ output ) : array { $ lines = explode ( PHP_EOL , $ output ) ; $ issues = [ ] ; $ lineNo = 1 ; foreach ( $ lines as $ line ) { $ line = trim ( $ line ) ; if ( '' === $ line ) { // Go to the next line $ lineNo ++ ; continue ; } switch ( $ line [ 0 ] ) { case '#' : $ parts = explode ( ' ' , $ line ) ; $ word = $ parts [ 1 ] ; $ issue = new Issue ( $ word ) ; $ issue -> line = $ lineNo ; $ issue -> offset = trim ( $ parts [ 2 ] ) ; $ issues [ ] = $ issue ; break ; case '&' : $ parts = explode ( ':' , $ line ) ; $ parts [ 0 ] = explode ( ' ' , $ parts [ 0 ] ) ; $ parts [ 1 ] = explode ( ', ' , trim ( $ parts [ 1 ] ) ) ; $ word = $ parts [ 0 ] [ 1 ] ; $ issue = new Issue ( $ word ) ; $ issue -> line = $ lineNo ; $ issue -> offset = trim ( $ parts [ 0 ] [ 3 ] ) ; $ issue -> suggestions = $ parts [ 1 ] ; $ issues [ ] = $ issue ; break ; } } return $ issues ; }
Parse ispell output.

@param string $output

@return Issue[]

@since 1.6
Parse ispell output .