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

Turns the statements found while walking a file into catalog entries.

Methods§

public function __construct(
    ?StatementKindReader $kinds = null,
    ?TableReader $tables = null,
    ?PlaceholderScanner $placeholders = null,
    ?EntryIdentity $identity = null,
)

Wires the factory to the readers that describe a statement.

Parameters

Calls 4
public function renumber(
    CatalogEntry $entry,
    QueryRecord $record,
    int $occurrence,
): CatalogEntry
public function merge(list<QueryRecord> $records): list<QueryRecord>

The records with every reading of the same statement folded into one.

Parameters

$recordslist<QueryRecord>

Returns

Test cases 2
Called from 1
Calls 1
public function groupBySite(list<QueryRecord> $records): array<string, list<QueryRecord>>

The records of each call site, keyed by the site.

Parameters

$recordslist<QueryRecord>

Returns

array<string, list<QueryRecord>>
Test cases 1
Called from 1
public function numberedValue(?string $name, array<int, Domain> $positional): ?Domain

The value a numbered parameter such as $1 binds to.

Parameters

$name?string
$positionalarray<int, Domain>

Returns

Test cases 2
Called from 1
Calls 1
public function findings(
    TextPattern $pattern,
    QueryRecord $record,
    list<Placeholder> $placeholders,
    bool $alternatives = false,
): list<Finding>

What is worth reporting about a statement.

Parameters

$patternTextPattern
$recordQueryRecord
$placeholderslist<Placeholder>
$alternativesboolWhether the call site produced more than one statement

Returns

list<Finding>
Test cases 11
Called from 1
Calls 19
public function notAnalyzedReason(QueryRecord $record): string
public function countMismatch(QueryRecord $record, list<Placeholder> $placeholders): ?Finding

The finding for a statement that binds a different number of values than it takes.

The count is only asserted for a call site that resolved to exactly one statement. Where the analyzer had to enumerate alternatives, one of them having a different number of placeholders is the enumeration talking, not the code.

Parameters

$recordQueryRecord
$placeholderslist<Placeholder>

Returns

Test cases 4
Called from 1
Calls 7

Private surface 4§

Implementation details, listed for orientation only.

private StatementKindReader $kinds
private TableReader $tables
private PlaceholderScanner $placeholders
private EntryIdentity $identity

Test cases 48§

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

Dedicated tests 42
Other tests reaching this symbol 6

Relations§

Instantiated in 1
Method calls 1
Type declarations 1