Make autoloader more PSR-4 (#268)

This commit is contained in:
Remi Collet 2016-04-15 15:07:30 +02:00 committed by Nikita Popov
parent 82bb6627c9
commit f8a40b3f24

View File

@ -31,7 +31,7 @@ class Autoloader
*/
static public function autoload($class) {
if (0 === strpos($class, 'PhpParser\\')) {
$fileName = dirname(__DIR__) . '/' . strtr($class, '\\', '/') . '.php';
$fileName = __DIR__ . strtr(substr($class, 9), '\\', '/') . '.php';
if (file_exists($fileName)) {
require $fileName;
}