Passed
Push — master ( d8dc61...dfdb64 )
by Sebastian
09:05
created

BaseCommandTranslation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A hasVariableEncodings() 0 3 2
1
<?php
2
/**
3
 * File containing the {@see \Mailcode\Translator\BaseCommandTranslation} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Translator
7
 * @see \Mailcode\Translator\BaseCommandTranslation
8
 */
9
10
declare(strict_types=1);
11
12
namespace Mailcode\Translator;
13
14
use Mailcode\Interfaces\Commands\EncodableInterface;
15
use Mailcode\Mailcode_Commands_Command;
16
17
/**
18
 * Abstract base class for syntax command translators.
19
 *
20
 * @package Mailcode
21
 * @subpackage Translator
22
 * @author Sebastian Mordziol <[email protected]>
23
 * 
24
 * @method string translate(Mailcode_Commands_Command $command)
25
 */
26
abstract class BaseCommandTranslation
27
{
28
    abstract public function getLabel() : string;
29
30
    abstract public function getSyntaxName() : string;
31
32
    protected function hasVariableEncodings(Mailcode_Commands_Command $command) : bool
33
    {
34
        return $command instanceof EncodableInterface && $command->hasActiveEncodings();
35
    }
36
}
37