Documentation

GitlabCiFormatter
in package
implements FormatterInterface

Formatter for GitLab CI Code Quality report (Code Climate JSON format).

Table of Contents

Interfaces

FormatterInterface

Properties

$fingerprints  : array<string|int, string>

Methods

endLinting()  : string
End linting a source file.
getName()  : non-empty-string
Returns the name used to select this formatter (e.g., 'plain', 'json').
printFatalError()  : string
Output a fatal error message.
printLintError()  : string
Output a parsing or runtime error message.
startLinting()  : string
Start linting a source file.
generateFingerprint()  : string
printCommaIfNeeded()  : string
printIssue()  : string

Properties

$fingerprints

private array<string|int, string> $fingerprints = []

Used to track fingerprints to avoid duplicates. This is not strictly necessary for GitLab CI, but helps ensure unique issues.

Methods

endLinting()

End linting a source file.

public endLinting(string $source, bool $isValid) : string
Parameters
$source : string

The source being linted (e.g., "CSS file "..."").

$isValid : bool

Whether the source is valid CSS.

Return values
string

getName()

Returns the name used to select this formatter (e.g., 'plain', 'json').

public getName() : non-empty-string
Return values
non-empty-string

printFatalError()

Output a fatal error message.

public printFatalError(string|null $source, mixed $error) : string
Parameters
$source : string|null

The source being linted (e.g., "CSS file "..."").

$error : mixed

The exception or error that occurred, which may include a message and stack trace.

Return values
string

printLintError()

Output a parsing or runtime error message.

public printLintError(string $source, LintError $lintError) : string
Parameters
$source : string

The source being linted (e.g., "CSS file "..."").

$lintError : LintError
Return values
string

startLinting()

Start linting a source file.

public startLinting(string $source) : string
Parameters
$source : string

The source being linted (e.g., "CSS file "..."").

Return values
string

printCommaIfNeeded()

private printCommaIfNeeded() : string
Return values
string

        
On this page

Search results