removed remaining code supporting PSR-0 class names

This commit is contained in:
Fabien Potencier
2019-04-23 18:21:46 +02:00
parent 7fb5fb4468
commit 5b1aad86f3
2 changed files with 2 additions and 15 deletions
+1 -2
View File
@@ -37,8 +37,7 @@ abstract class CallExpression extends AbstractExpression
$compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1]));
}
} elseif ($r instanceof \ReflectionMethod && $callable[0] instanceof ExtensionInterface) {
// For BC/FC with namespaced aliases
$class = (new \ReflectionClass(\get_class($callable[0])))->name;
$class = \get_class($callable[0]);
if (!$compiler->getEnvironment()->hasExtension($class)) {
// Compile a non-optimized call to trigger a \Twig\Error\RuntimeError, which cannot be a compile-time error
$compiler->raw(sprintf('$this->env->getExtension(\'%s\')', $class));