Documentation

FormatterInterface

Table of Contents

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.

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, Throwable|string $error) : string
Parameters
$source : string|null

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

$error : Throwable|string

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 $error) : string
Parameters
$source : string

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

$error : LintError

The error to be printed, which may include details like line number, column, and message.

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

        
On this page

Search results