Mailcode_Commands_Command_ShowSnippet   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 14
c 2
b 0
f 0
dl 0
loc 31
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getValidations() 0 6 1
A getName() 0 3 1
A getLabel() 0 3 1
A generatesContent() 0 3 1
1
<?php
2
/**
3
 * File containing the {@see Mailcode_Commands_Command_ShowSnippet} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Commands
7
 * @see Mailcode_Commands_Command_ShowSnippet
8
 */
9
10
declare(strict_types=1);
11
12
namespace Mailcode;
13
14
/**
15
 * Mailcode command: show a variable value.
16
 *
17
 * @package Mailcode
18
 * @subpackage Commands
19
 * @author Sebastian Mordziol <[email protected]>
20
 */
21
class Mailcode_Commands_Command_ShowSnippet
22
    extends Mailcode_Commands_ShowBase
23
    implements
24
    Mailcode_Interfaces_Commands_Validation_NoHTML,
25
    NamespaceInterface
26
{
27
    use Mailcode_Traits_Commands_Validation_NoHTML;
28
    use NamespaceTrait;
29
30
    public function getName(): string
31
    {
32
        return 'showsnippet';
33
    }
34
35
    public function getLabel(): string
36
    {
37
        return t('Show text snippet');
38
    }
39
40
    protected function getValidations(): array
41
    {
42
        return array(
43
            Mailcode_Interfaces_Commands_Validation_Variable::VALIDATION_NAME_VARIABLE,
44
            Mailcode_Interfaces_Commands_Validation_NoHTML::VALIDATION_NAME_NOHTML,
45
            NamespaceInterface::VALIDATION_NAMESPACE_NAME
46
        );
47
    }
48
49
    public function generatesContent(): bool
50
    {
51
        return true;
52
    }
53
}
54