forked from ateli-development/phpstan-magento1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan-bootstrap.php
More file actions
26 lines (20 loc) · 812 Bytes
/
phpstan-bootstrap.php
File metadata and controls
26 lines (20 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
declare(strict_types=1);
use PHPStanMagento1\Autoload\Magento\ModuleControllerAutoloader;
(new ModuleControllerAutoloader('local'))->register();
(new ModuleControllerAutoloader('core'))->register();
(new ModuleControllerAutoloader('community'))->register();
/**
* We replace the original Varien_Autoload autoloader with a custom one.
*/
spl_autoload_register(static function($className) {
spl_autoload_unregister([Varien_Autoload::instance(), 'autoload']);
$classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $className)));
$classFile .= '.php';
foreach (explode(':', get_include_path()) as $path) {
if (\file_exists($path . DIRECTORY_SEPARATOR . $classFile)) {
return include $classFile;
}
}
}, true, true);
Mage::app();