Skip to content

Commit

Permalink
Merge e1d8be3 into 1f04a53
Browse files Browse the repository at this point in the history
  • Loading branch information
thorewi committed Nov 26, 2020
2 parents 1f04a53 + e1d8be3 commit 859ce18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/DI/TranslationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
use Nette\Reflection\ClassType as ReflectionClassType;
use Nette\Schema\Expect;
use Nette\Schema\Schema;
use Nette\Utils\Callback;
use Nette\Utils\Finder;
use Nette\Utils\Validators;
use Symfony\Component\Translation\Extractor\ChainExtractor;
Expand Down Expand Up @@ -372,7 +371,7 @@ public function beforeCompile()
return str_replace((DIRECTORY_SEPARATOR === '/') ? '\\' : '/', DIRECTORY_SEPARATOR, Helpers::expand($dir, $builder->parameters));
}, $config['dirs']);

$dirs = array_values(array_filter($config['dirs'], Callback::closure('is_dir')));
$dirs = array_values(array_filter($config['dirs'], \Closure::fromCallable('is_dir')));
if (count($dirs) > 0) {
foreach ($dirs as $dir) {
$builder->addDependency($dir);
Expand Down
3 changes: 2 additions & 1 deletion src/Latte/TranslateMacros.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static function install(Compiler $compiler)
$me = new static($compiler);
/** @var \Kdyby\Translation\Latte\TranslateMacros $me */


$me->addMacro('_', [$me, 'macroTranslate'], [$me, 'macroTranslate']);
$me->addMacro('translator', [$me, 'macroDomain'], [$me, 'macroDomain']);

Expand All @@ -48,7 +49,7 @@ public function macroTranslate(MacroNode $node, PhpWriter $writer)
$value = 'ob_get_clean()';
}

return $writer->write('$_fi = new LR\FilterInfo(%var); echo %modifyContent($this->filters->filterContent("translate", $_fi, %raw))', $node->context[0], $value);
return $writer->write('$__fi = new LR\FilterInfo(%var); echo %modifyContent($this->filters->filterContent("translate", $__fi, %raw))', $node->context[0], $value);

} elseif ($node->args !== '') {
$node->empty = TRUE;
Expand Down

0 comments on commit 859ce18

Please sign in to comment.