for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File containing the {@see Mailcode_Translator_Syntax_ApacheVelocity} class.
*
* @package Mailcode
* @subpackage Translator
* @see Mailcode_Translator_Syntax_ApacheVelocity
*/
declare(strict_types=1);
namespace Mailcode;
* Allows translation mailcode to apache velocity syntax.
* @author Sebastian Mordziol <[email protected]>
class Mailcode_Translator_Syntax_ApacheVelocity extends Mailcode_Translator_Syntax
{
protected function _translateElseIf(Mailcode_Commands_Command_ElseIf $command): string
$params = $command->getParams();
if($params)
$params
Mailcode\Mailcode_Parser_Statement
true
return sprintf(
'#elseif(%s)',
$params->getNormalized()
);
}
return '';
protected function _translateElse(Mailcode_Commands_Command_Else $command): string
return '#{else}';
protected function _translateIf(Mailcode_Commands_Command_If $command): string
'#if(%s)',
protected function _translateShowVariable(Mailcode_Commands_Command_ShowVariable $command): string
return '${'.ltrim($command->getVariableName(), '$').'}';
protected function _translateFor(Mailcode_Commands_Command_For $command): string
'#for(%s)',
protected function _translateSetVariable(Mailcode_Commands_Command_SetVariable $command): string
'#set(%s)',
protected function _translateEnd(Mailcode_Commands_Command_End $command): string
return '#{end}';