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

The catalog grouped along every route a reader can take to a statement.

A reader rarely wants the whole catalog. They want the statements on one table, the ones a class issues, the ones in a file, or the ones a function writes with values it does not control. Each of those is a grouping of the same entries, and the groupings are built once here so every page addresses the same statement through the same keys.

Methods§

public function __construct(Catalog $catalog)

Groups a catalog, in the order the report lists statements.

Parameters

$catalogCatalog
Calls 3
public function entries(): list<CatalogEntry>

The statements, in reporting order.

Returns

Test cases 1
public function byFunction(): array<string, list<CatalogEntry>>

The statements each function issues, in the order the functions are met.

Returns

array<string, list<CatalogEntry>>
Test cases 1
public function byClass(): array<string, list<CatalogEntry>>

The statements each class issues through its methods, in name order.

Returns

array<string, list<CatalogEntry>>
Test cases 2
Called from 1
Calls 2
public function byNamespace(): array<string, list<CatalogEntry>>

The statements issued under each namespace, the global one first.

Returns

array<string, list<CatalogEntry>>
Test cases 2
Calls 2
public function byDirectory(): array<string, list<string>>

The files under each directory, in path order.

Returns

array<string, list<string>>
Test cases 2
Calls 4
public function byRule(): array<string, list<CatalogEntry>>

The statements each rule reported on, most reported first.

Returns

array<string, list<CatalogEntry>>
Test cases 1
Calls 2
public function usage(list<CatalogEntry> $entries): array{reads: int, writes: int, schema: int, other: int, attention: int}

How a set of statements uses what it names.

Parameters

$entrieslist<CatalogEntry>

Returns

array{reads: int, writes: int, schema: int, other: int, attention: int}
Test cases 1
Calls 2
public function tablesOf(list<CatalogEntry> $entries): array<string, int>

How often each table is named by a set of statements, most named first.

Parameters

$entrieslist<CatalogEntry>

Returns

array<string, int>
Test cases 1
Calls 1
public function functionsOf(list<CatalogEntry> $entries): array<string, int>

How many statements each function issues among a set, most first.

Parameters

$entrieslist<CatalogEntry>

Returns

array<string, int>
Test cases 1
Calls 1
public function alongside(string $table): array<string, int>

The tables named alongside one table, most often first.

Parameters

$tablestring

Returns

array<string, int>
Test cases 1
Called from 1
Calls 2
public function hotspots(): list<array{function: string, file: string, high: int, medium: int}>

The functions issuing statements that need attention, worst first.

Returns

list<array{function: string, file: string, high: int, medium: int}>
Test cases 2
Calls 3
public function mostFirst(array<string, int> $counts): array<string, int>

Private surface 2§

Implementation details, listed for orientation only.

private list<CatalogEntry> $entries
private array<string, list<CatalogEntry>> $unreadFiles = []

Test cases 38§

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

Dedicated tests 20
Other tests reaching this symbol 18

Relations§

Instantiated in 1
Method calls 6
Type declarations 3