From cf603b19c1ad8538a3bf3305ac5ef819b33c82b6 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 5 Oct 2024 09:33:37 +0200 Subject: [PATCH] Remove remaining usages of get_class() --- src/Environment.php | 2 +- src/Node/Expression/Test/ConstantTest.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Environment.php b/src/Environment.php index 1d90641c4..9bce904e0 100644 --- a/src/Environment.php +++ b/src/Environment.php @@ -233,7 +233,7 @@ class Environment if ($this->cache instanceof RemovableCacheInterface) { $this->cache->remove($name, $cls); } else { - throw new \LogicException(\sprintf('The "%s" cache class does not support removing template cache as it does not implement the "RemovableCacheInterface" interface.', \get_class($this->cache))); + throw new \LogicException(\sprintf('The "%s" cache class does not support removing template cache as it does not implement the "RemovableCacheInterface" interface.', $this->cache::class)); } } diff --git a/src/Node/Expression/Test/ConstantTest.php b/src/Node/Expression/Test/ConstantTest.php index 1ef95fbfe..b21e95948 100644 --- a/src/Node/Expression/Test/ConstantTest.php +++ b/src/Node/Expression/Test/ConstantTest.php @@ -35,9 +35,8 @@ class ConstantTest extends TestExpression if ($this->getNode('arguments')->hasNode('1')) { $compiler - ->raw('get_class(') ->subcompile($this->getNode('arguments')->getNode(1)) - ->raw(')."::".') + ->raw('::class."::".') ; }