final class JsonReporter
    implements ReporterInterface
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Writes the catalog as JSON, in an order two runs can be compared in.

Nothing that changes between runs of the same source, such as a timestamp, is written, so the artifact can be committed and its diff read as the change in the SQL an application issues.

Type Aliases§

BoundValue = array{type: string, values: list<string|int|float|bool|null>, exhaustive: bool, origins: list<string>}
PlaceholderNode = array{token: string, position: int, name: string|null, value: BoundValue|null}
FindingNode = array{rule: string, severity: string, message: string}
SiteNode = array{file: string, line: int, function: string, sink: string}
StatementNode = array{id: string, kind: string, sql: string, exact: bool, resolution: string, searchClosed: bool, correlated: bool, tables: list<string>, site: SiteNode, through: list<string>, placeholders: list<PlaceholderNode>, findings: list<FindingNode>}
SummaryNode = array{statements: int, resolved: int, undetermined: int, findings: int}
CatalogDocument = array{'$schema': string, version: int, analysis: array{conditions: string, reachability: string}, summary: SummaryNode, statements: list<StatementNode>, problems: list<array{file: string, message: string}>}

Constants§

public const VERSION = 2

The format version written into the document.

public const FILE = 'catalog.json'

The name the artifact is written under.

public const SCHEMA_FILE = 'catalog-schema.json'

The name the schema describing the artifact is written under.

Methods§

public function name(): string

The name the command line selects this reporter by.

Returns

string
Test cases 1
public function description(): string

What the reporter produces.

Returns

string
Test cases 1
public function schema(): string

The schema the document declares itself against.

The schema is written beside the document rather than pointed at over the network, so a catalog that has been committed, copied or archived stays readable without asking anything else for the shape of it.

Returns

string
Test cases 2
Called from 1
Calls 3
public function summary(Catalog $catalog): SummaryNode

The counts a reader looks at first.

Parameters

$catalogCatalog
Test cases 1
Called from 1
Calls 2

Test cases 24§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 14
Other tests reaching this symbol 10

Relations§

Instantiated in 1