File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33require_once __DIR__ . '/vendor/autoload.php ' ;
44
5+ // Registered *after* Composer's class loader: the third argument (prepend)
6+ // defaults to false, so this ends up at the back of the spl_autoload queue.
7+ //
8+ // \other12972\MyClass is part of Composer's class map (see composer.json), so at
9+ // runtime Composer's class loader resolves it first and this autoloader is never
10+ // invoked for it - running `php real-world.php` therefore never throws.
11+ //
12+ // PHPStan must mirror that order: the Composer class map source locator has to
13+ // resolve the class before this bootstrap autoloader is consulted. Analysing the
14+ // project used to invoke this autoloader first, hitting the LogicException and
15+ // crashing with an internal error that cannot happen at runtime.
516spl_autoload_register (function ($ class ) {
617 if ($ class === \other12972 \MyClass::class) {
718 throw new LogicException ('this should not happen ' );
You can’t perform that action at this time.
0 commit comments