diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 2c1e0909..3789de8d 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -14,10 +14,9 @@ parameters: - src/Modules - src/Cli - # No Composer + no namespaces. The bootstrap only defines global constants; - # it does NOT run the project autoloader (that would force a live directory - # rescan per class miss and crash the workers). PHPStan resolves every - # symbol statically from `paths` + `scanDirectories` below. + # The bootstrap only defines global constants; it does NOT wire a project + # autoloader. PHPStan resolves every symbol statically from `paths` + + # `scanDirectories` below (no project code is executed). bootstrapFiles: - tools/phpstan/phpstan-bootstrap.php # Listed directly (not just require'd from the bootstrap) so PHPStan diff --git a/tools/phpstan/phpstan-bootstrap.php b/tools/phpstan/phpstan-bootstrap.php index bf8a33cc..e7609837 100644 --- a/tools/phpstan/phpstan-bootstrap.php +++ b/tools/phpstan/phpstan-bootstrap.php @@ -3,15 +3,12 @@ /** * PHPStan bootstrap for XC_VM. * - * The project has no Composer and no PSR-4 namespaces. We deliberately do NOT - * include src/autoload.php here: registering the runtime class-map autoloader - * makes PHPStan execute a full live directory rescan on every class miss - * (the igbinary cache is unavailable on a plain CLI), which exhausts memory - * and crashes the parallel workers. - * - * Instead, PHPStan discovers every class/interface/function on its own by - * statically scanning the directories listed under `paths` and - * `scanDirectories` in phpstan.dist.neon — no project code is executed. + * The project uses Composer PSR-4, but this bootstrap deliberately does NOT wire + * a project autoloader. PHPStan discovers every class/interface/function itself + * by statically scanning the directories listed under `paths` and + * `scanDirectories` in phpstan.dist.neon — no project code is executed. (The + * Composer-installed phpstan binary loads src/vendor/autoload.php for its own + * dependencies.) * * This file only defines the global constants the codebase references so that * analysis of constant-dependent expressions stays accurate.