1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
psalm/tests/fixtures/SuicidalAutoloader/autoloader.php
Bruce Weirdan 9027bc6190 Added SuicidalAutoloader test (#2399)
The idea behind this is that Psalm should not use project autoloader for
its own things. So if we have a project with autoloader and no code,
then any project autoloader hit means Psalm failed to load something
itself.

Right now it highlights several issues in CoreGenericClasses stub:
- usage of `callback` instead of `callable`
- `@property-read` not resolving template parameters
2019-11-30 00:09:07 -05:00

7 lines
216 B
PHP

<?php
spl_autoload_register(function (string $className) {
$ex = new RuntimeException('Attempted to load ' . $className);
echo $ex->__toString() . "\n\n" . $ex->getTraceAsString() . "\n\n";
exit(70);
});