tests/RulesTest.php
/**
     * Returns an associative Collection where each key represents the line
     * number and the value represents the error found. Will return
     * at most one error per line.
     * @param string $filename
     * @return array<int, string>
     */
Returns an associative Collection where each key represents the line
number and the value represents the error found. Will return
at most one error per line.
@param string $filename
@return array
Returns an associative Collection where each key represents the line number and the value represents the error found . Will return at most one error per line . @param string $filename @return array
protected function findErrorsByLine(string $filename): array
    {
        $errors = $this->findErrors(realpath($filename));
        return collect($errors['messages'] ?? [])->mapWithKeys(function ($message) {
            return [$message['line'] => $message['message']];
        })->toArray();
    }
protected function findErrorsByLine ( string $ filename ) : array { $ errors = $ this -> findErrors ( realpath ( $ filename ) ) ; return collect ( $ errors [ 'messages' ] ?? [ ] ) -> mapWithKeys ( function ( $ message ) { return [ $ message [ 'line' ] => $ message [ 'message' ] ] ; } ) -> toArray ( ) ; }
Returns an associative Collection where each key represents the line
 number and the value represents the error found.
Returns an associative Collection where each key represents the line number and the value represents the error found .