Skip to content

Commit

Permalink
fix: block compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
papac committed Dec 16, 2024
1 parent a39c4a6 commit 2aad22a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Lexique/CompileHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function compileLang(string $expression): string
* @param string $expression
* @return string
*/
protected function compileTrans(string $expression): string
protected function compileapp_trans(string $expression): string
{
return $this->compileHelpersStatement($expression, '%trans');
}
Expand Down
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
2 changes: 1 addition & 1 deletion tests/CompileHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function testCompileTransStatement()
{
$compileService = $this->makeReflectionFor('compileTrans');

$render = $compileService->invoke($this->compiler, '%trans("user.service")');
$render = $compileService->invoke($this->compiler, '%app_trans("user.service")');
$this->assertEquals($render, '<?php echo __("user.service"); ?>');
}

Expand Down

0 comments on commit 2aad22a

Please sign in to comment.