Skip to content

Commit

Permalink
Merge pull request #81 from bowphp/fix/raw
Browse files Browse the repository at this point in the history
test: fix trans compilation
  • Loading branch information
papac authored Dec 16, 2024
2 parents a39c4a6 + 7882b98 commit 6de5339
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/StackManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public function endStack()
public function getStack(string $name, ?string $default = null)
{
if (array_key_exists($name, $this->pushes)) {
if (is_null($this->pushes[$name])) {
$this->pushes[$name] = $default ?? '';
}
return $this->tintin->renderString(
$this->pushes[$name],
['__tintin' => $this->tintin]
Expand Down
1 change: 1 addition & 0 deletions tests/CompileHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function testCompileTransStatement()
$compileService = $this->makeReflectionFor('compileTrans');

$render = $compileService->invoke($this->compiler, '%trans("user.service")');

$this->assertEquals($render, '<?php echo __("user.service"); ?>');
}

Expand Down

0 comments on commit 6de5339

Please sign in to comment.