Passed
Push — master ( 1b5df6...213867 )
by Sebastian
13:22
created

Mailcode_Translator_Syntax_ApacheVelocity_SetVariable   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A translate() 0 6 1
1
<?php
2
/**
3
 * File containing the {@see Mailcode_Translator_Syntax_ApacheVelocity_SetVariable} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Translator
7
 * @see Mailcode_Translator_Syntax_ApacheVelocity_SetVariable
8
 */
9
10
declare(strict_types=1);
11
12
namespace Mailcode;
13
14
/**
15
 * Translates the "SetVariable" command to Apache Velocity.
16
 *
17
 * @package Mailcode
18
 * @subpackage Translator
19
 * @author Sebastian Mordziol <[email protected]>
20
 */
21
class Mailcode_Translator_Syntax_ApacheVelocity_SetVariable extends Mailcode_Translator_Syntax_ApacheVelocity implements Mailcode_Translator_Command_SetVariable
22
{
23
    public function translate(Mailcode_Commands_Command_SetVariable $command): string
24
    {
25
        return sprintf(
26
            '#set(%s = %s)',
27
            $command->getVariable()->getFullName(),
28
            $command->getValue()->getValue()
29
        );
30
    }
31
}
32