mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +01:00
Make autoloader more PSR-4 (#268)
This commit is contained in:
parent
82bb6627c9
commit
f8a40b3f24
@ -31,7 +31,7 @@ class Autoloader
|
|||||||
*/
|
*/
|
||||||
static public function autoload($class) {
|
static public function autoload($class) {
|
||||||
if (0 === strpos($class, 'PhpParser\\')) {
|
if (0 === strpos($class, 'PhpParser\\')) {
|
||||||
$fileName = dirname(__DIR__) . '/' . strtr($class, '\\', '/') . '.php';
|
$fileName = __DIR__ . strtr(substr($class, 9), '\\', '/') . '.php';
|
||||||
if (file_exists($fileName)) {
|
if (file_exists($fileName)) {
|
||||||
require $fileName;
|
require $fileName;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user