From 24736873f6d2871c325e3f57347cbb400cd20cd8 Mon Sep 17 00:00:00 2001 From: Divarion_D Date: Fri, 7 Aug 2026 20:51:02 +0300 Subject: [PATCH] chore(phpstan): correct stale "no Composer/PSR-4" bootstrap comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit phpstan-bootstrap.php and phpstan.dist.neon claimed the project "has no Composer and no PSR-4 namespaces" and referenced the removed src/autoload.php — both false since the Composer PSR-4 migration (and self-contradicted by the neon's own excludePaths note about src/vendor/autoload.php). Comment-only: they now state the bootstrap defines constants and deliberately wires no project autoloader (PHPStan discovers symbols via paths + scanDirectories). No behavior change. --- phpstan.dist.neon | 7 +++---- tools/phpstan/phpstan-bootstrap.php | 15 ++++++--------- 2 files changed, 9 insertions(+), 13 deletions(-) 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.