1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2025-01-22 13:51:12 +01:00

Simplify code

The new class couldn't already exist at that point - if it did, the
old name would have been aliased already and the autoloader wouldn't
trigger.
This commit is contained in:
Nikita Popov 2015-04-03 22:30:30 +02:00
parent 6aaa87f143
commit e4eab9ec0c

View File

@ -40,15 +40,8 @@ class Autoloader
return;
}
$newClass = self::$php7AliasesOldToNew[$class];
if (class_exists($newClass, false)) {
// If the new class is already loaded, alias it right away
class_alias($class, $newClass);
return;
}
// Otherwise load the new class and create the alias afterwards
$class = $newClass;
// Load the new class, alias will be registered afterwards
$class = self::$php7AliasesOldToNew[$class];
}
$fileName = dirname(__DIR__) . '/' . strtr($class, '\\', '/') . '.php';