mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2025-01-21 21:01:15 +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:
parent
6aaa87f143
commit
e4eab9ec0c
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user