Files
XC_VM/tools/phpstan/phpstan-bootstrap.php
T
Divarion_D 24736873f6 chore(phpstan): correct stale "no Composer/PSR-4" bootstrap comments
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.
2026-08-07 20:51:02 +03:00

27 lines
887 B
PHP

<?php
/**
* PHPStan bootstrap for XC_VM.
*
* 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.
*
* @package XC_VM
*/
$srcRoot = dirname(__DIR__, 2) . '/src';
if (!defined('MAIN_HOME')) {
define('MAIN_HOME', $srcRoot . '/');
}
// NOTE: constants.stub.php is loaded via its own bootstrapFiles entry in
// phpstan.dist.neon (so PHPStan tracks it for result-cache invalidation).