Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function translate(Mailcode_Commands_Command_End $command): string |
||
28 | { |
||
29 | $openCmd = $command->getOpeningCommand(); |
||
30 | |||
31 | // This ending command is tied to a preprocessing command: Since |
||
32 | // we do not want to keep these, we return an empty string to strip |
||
33 | // it out. |
||
34 | if($openCmd instanceof Mailcode_Interfaces_Commands_PreProcessing) { |
||
35 | return ''; |
||
36 | } |
||
37 | |||
38 | if($openCmd instanceof Mailcode_Commands_Command_For) { |
||
39 | return '{% endfor %}'; |
||
40 | } |
||
41 | |||
42 | if($openCmd instanceof Mailcode_Commands_IfBase) { |
||
43 | return '{% endif %}'; |
||
44 | } |
||
45 | |||
46 | return '{# ! Unknown opening command for end command ! #}'; |
||
47 | } |
||
49 |