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; 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';