2019-11-30 06:09:07 +01:00
|
|
|
<?php
|
2020-07-11 23:17:22 +02:00
|
|
|
|
|
|
|
use React\Promise\PromiseInterface as ReactPromise;
|
2020-07-20 10:53:16 +02:00
|
|
|
use ResourceBundle;
|
|
|
|
use Transliterator;
|
|
|
|
use Composer\InstalledVersions;
|
2020-07-11 23:17:22 +02:00
|
|
|
|
2019-11-30 06:09:07 +01:00
|
|
|
spl_autoload_register(function (string $className) {
|
2020-07-11 23:17:22 +02:00
|
|
|
$knownBadClasses = [
|
|
|
|
ReactPromise::class, // amphp/amp
|
|
|
|
ResourceBundle::class, // symfony/polyfill-php73
|
|
|
|
Transliterator::class, // symfony/string
|
2020-07-20 10:53:16 +02:00
|
|
|
InstalledVersions::class, // composer v2
|
2020-07-11 23:17:22 +02:00
|
|
|
// it's unclear why Psalm tries to autoload parent
|
|
|
|
'parent',
|
|
|
|
];
|
|
|
|
|
|
|
|
if (in_array($className, $knownBadClasses)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-11-30 06:09:07 +01:00
|
|
|
$ex = new RuntimeException('Attempted to load ' . $className);
|
|
|
|
echo $ex->__toString() . "\n\n" . $ex->getTraceAsString() . "\n\n";
|
|
|
|
exit(70);
|
|
|
|
});
|