mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2025-01-22 05:11:39 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$newClass = self::$php7AliasesOldToNew[$class];
|
// Load the new class, alias will be registered afterwards
|
||||||
if (class_exists($newClass, false)) {
|
$class = self::$php7AliasesOldToNew[$class];
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$fileName = dirname(__DIR__) . '/' . strtr($class, '\\', '/') . '.php';
|
$fileName = dirname(__DIR__) . '/' . strtr($class, '\\', '/') . '.php';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user