final |
|---|
Activates the phpstan_turbo extension's shadowing classes.
The extension registers nothing under PHPStan's class names at module startup. Once the Composer autoloader is registered, activateIfCompatible() checks the loaded extension's version against getExpectedVersion() and, when it matches, asks Runtime::activateShadowing() to declare the native classes under the PHP twins' real names — PHPStan\TrinaryLogic then is the native class, linked like a PHP declaration (parents and interfaces resolved through the autoloader). A mismatched or absent extension never gets the call, and the PHP implementations load as usual.
The version is the short SHA of the last commit touching turbo-ext/src/, which the extension's build bakes into the binary and build/generate-turbo-manifest.php writes into vendor/turbo-extension-version.php on every autoloader dump — the phar carries the file from its compilation. The native classes must behave exactly like the PHP implementations, hence the gate.
| Methods | ||
|---|---|---|
public
static
|
isActive(): bool
|
# |
public
static
|
activateIfCompatible(?string $pharPath = null): void
|
# |
public
static
|
trustOwnTypesIfSuitable(list<string> $argv, ?string $pharPath = null): void
|
# |