API / Minn\Runtime / SymbolGap

SymbolGap final readonly class

Minn\Runtime\SymbolGap · public/minn/src/Minn/Runtime/SymbolGap.php · 196 lines

The part of the reference's interface the runtime does not answer: names in data/api-names.json that no facade file defines. It is the whole input the symbol gate needs, so it can be exported to JSON and carried to a machine that holds plugin source but no engine, which is how the catalogue-wide compatibility scan runs.

Uses 1

Constants and properties

propreadonly array $functions

Promoted from the constructor.

propreadonly array $classes

Promoted from the constructor.

propreadonly array $known

Promoted from the constructor.

propreadonly array $pluggable

Promoted from the constructor.

Public

new__construct(array $functions, array $classes, array $known = array ( ), array $pluggable = array ( ))#
$functionsarray<string, true>lower-cased function names the runtime lacks
$classesarray<string, true>lower-cased class, interface, trait, and enum names it lacks
$knownarray<string, true>lower-cased function names in the reference's interface, lacking or not
$pluggablearray<string, true>lower-cased pluggable functions the runtime defines after the plugins load
staticofLoadedFacade(string $engineDir): self#

Reads the reference's interface and subtracts everything the loaded facade defines. A plugin may define a name as it loads, so each call asks again, but only about the names still lacking: a name once defined stays defined, and asking about all four thousand for every plugin was a cost of its own.

staticofShippedFacade(string $engineDir): self#

The gap read from the engine's own files without loading them, for a machine that has the engine but runs no site with it yet (preflight): a name counts as defined when a facade file declares it.

staticfromFile(string $path): self#

The gap read from its JSON file.

methodlacksFunction(string $name): bool#

Whether the runtime lacks a function.

methoddefines(string $name): bool#

Whether the runtime already defines a function of the reference's interface, so a plugin declaring it again without a guard would fail to compile. The pluggable functions are not counted: the runtime defines those after the plugins load, each only where no plugin did.

methodlacksClass(string $name): bool#

Whether the runtime lacks a class.

methodjson(): string#

The gap as JSON.

Internals 2

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatetypeExists(string $name): bool#

Whether a class, interface, trait or enum of this name is defined.

privatedeclaredIn(string $source): array#

The global functions and the classes (with their namespace) one file declares, lower-cased; a method, a closure and an anonymous class are not declarations.

@return array{0: array<string, true>, 1: array<string, true>}