From f8fa6c515bf52c02bf48f2fe3feb72485ad8e974 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 27 Jun 2016 11:30:58 +0200 Subject: [PATCH] Compiler: set default $contentType --- src/Latte/Compiler/Compiler.php | 2 +- tests/Latte/CoreMacros.translate.phpt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Latte/Compiler/Compiler.php b/src/Latte/Compiler/Compiler.php index d17867585..8da2d5947 100644 --- a/src/Latte/Compiler/Compiler.php +++ b/src/Latte/Compiler/Compiler.php @@ -40,7 +40,7 @@ class Compiler private $placeholders = []; /** @var string */ - private $contentType; + private $contentType = self::CONTENT_HTML; /** @var array [context, subcontext] */ private $context; diff --git a/tests/Latte/CoreMacros.translate.phpt b/tests/Latte/CoreMacros.translate.phpt index 5df890c95..b2c628ac4 100644 --- a/tests/Latte/CoreMacros.translate.phpt +++ b/tests/Latte/CoreMacros.translate.phpt @@ -15,5 +15,5 @@ $compiler = new Latte\Compiler; CoreMacros::install($compiler); // {_...} -Assert::same('filters->escape, call_user_func($this->filters->translate, \'var\')) ?>', $compiler->expandMacro('_', 'var', '')->openingCode); -Assert::same('filters->escape, call_user_func($this->filters->filter, call_user_func($this->filters->translate, \'var\'))) ?>', $compiler->expandMacro('_', 'var', '|filter')->openingCode); +Assert::same('filters->translate, \'var\')) ?>', $compiler->expandMacro('_', 'var', '')->openingCode); +Assert::same('filters->filter, call_user_func($this->filters->translate, \'var\'))) ?>', $compiler->expandMacro('_', 'var', '|filter')->openingCode);