From 3b5f9cec1ef35bc1215d141dabb045071f00d094 Mon Sep 17 00:00:00 2001 From: Radoslav Damjanov Date: Wed, 1 Nov 2023 15:18:36 +0100 Subject: [PATCH] Fix PHP error, type property must not be accessed before initialization. --- src/Twig/TerrificCompiler.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Twig/TerrificCompiler.php b/src/Twig/TerrificCompiler.php index 629dd2d..5a49233 100644 --- a/src/Twig/TerrificCompiler.php +++ b/src/Twig/TerrificCompiler.php @@ -45,6 +45,7 @@ class TerrificCompiler implements TerrificCompilerInterface { */ protected function __construct(Compiler $compiler) { $this->compiler = $compiler; + $this->expressionHandler = ExpressionHandler::create(); } /** @@ -195,10 +196,6 @@ public function compileAndMergeVariableToContext(VariableNameAndArrayKeysPair $v * The expression handler. */ public function getExpressionHandler(): ExpressionHandler { - if (!$this->expressionHandler instanceof ExpressionHandler) { - $this->expressionHandler = ExpressionHandler::create(); - } - return $this->expressionHandler; }