Skip to content

Commit

Permalink
Compiler: set default $contentType
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jun 27, 2016
1 parent ead1f85 commit f8fa6c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Latte/Compiler/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Compiler
private $placeholders = [];

/** @var string */
private $contentType;
private $contentType = self::CONTENT_HTML;

/** @var array [context, subcontext] */
private $context;
Expand Down
4 changes: 2 additions & 2 deletions tests/Latte/CoreMacros.translate.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $compiler = new Latte\Compiler;
CoreMacros::install($compiler);

// {_...}
Assert::same('<?php echo call_user_func($this->filters->escape, call_user_func($this->filters->translate, \'var\')) ?>', $compiler->expandMacro('_', 'var', '')->openingCode);
Assert::same('<?php echo call_user_func($this->filters->escape, call_user_func($this->filters->filter, call_user_func($this->filters->translate, \'var\'))) ?>', $compiler->expandMacro('_', 'var', '|filter')->openingCode);
Assert::same('<?php echo LR\Filters::escapeHtmlText(call_user_func($this->filters->translate, \'var\')) ?>', $compiler->expandMacro('_', 'var', '')->openingCode);
Assert::same('<?php echo LR\Filters::escapeHtmlText(call_user_func($this->filters->filter, call_user_func($this->filters->translate, \'var\'))) ?>', $compiler->expandMacro('_', 'var', '|filter')->openingCode);

0 comments on commit f8fa6c5

Please sign in to comment.