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

Decides whether a call in the source is one of the database calls to catalog.

Methods§

public function __construct(
    list<SinkSpec> $sinks,
    ProgramIndex $index,
    private ?ModelSet $models = null,
)

Parameters

$sinkslist<SinkSpec>The calls the enabled extensions recognise
$indexProgramIndexThe declarations of the analyzed source, for subclass checks
$models?ModelSet
public function matchStatic(string $className, string $method): ?SinkSpec
public function models(Domain $receiver): bool

Whether an extension already models what the receiver is.

An extension that names a class's calls is the model of that class. Walking into that class's own implementation from every call site re-derives the statements it issues at the sites they are already read from, once per caller, which costs a great deal and adds nothing that reading the class itself does not give.

Parameters

$receiverDomain

Returns

bool
Test cases 1
Called from 1
Calls 1
public function receiverMatches(Domain $receiver, string $expected): bool
public function classMatches(string $className, string $expected): bool

Whether a class is, or inherits from, the expected one.

Inheritance is read from the analyzed source first, so a drop-in replacement declared in the project is recognised, and from the running process second, which is what resolves the built-in driver classes.

Parameters

$classNamestring
$expectedstring

Returns

bool
Test cases 6
Called from 2
Calls 5

Private surface 3§

Implementation details, listed for orientation only.

private list<SinkSpec> $sinks
private ProgramIndex $index
private ?ModelSet $models = null

Test cases 75§

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 61

Relations§

Instantiated in 3
Method calls 10
Type declarations 7