Completed
Push — master ( 216072...caf6f7 )
by Team eFabrica
02:21
created

Token   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 48
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A changeTranslationKey() 0 4 1
A __construct() 0 6 1
A getTranslationKey() 0 3 1
A getOriginalText() 0 3 1
A getOriginalBlock() 0 3 1
A changeTranslationCode() 0 4 1
A getTranslationCode() 0 3 1
1
<?php
2
3
namespace Efabrica\TranslationsAutomatization\Tokenizer;
4
5
class Token
6
{
7
    private $originalText;
8
9
    private $originalBlock;
10
11
    private $translationKey;
12
13
    private $translationCode;
14
15 26
    public function __construct(string $originalText, string $originalBlock)
16
    {
17 26
        $this->originalText = $originalText;
18 26
        $this->originalBlock = $originalBlock;
19 26
        $this->translationKey = $originalText;
20 26
        $this->translationCode = $originalText;
21 26
    }
22
23 6
    public function getOriginalText(): string
24
    {
25 6
        return $this->originalText;
26
    }
27
28 6
    public function getOriginalBlock(): string
29
    {
30 6
        return $this->originalBlock;
31
    }
32
33 18
    public function getTranslationKey(): string
34
    {
35 18
        return $this->translationKey;
36
    }
37
38 14
    public function changeTranslationKey(string $newTranslationKey): Token
39
    {
40 14
        $this->translationKey = $newTranslationKey;
41 14
        return $this;
42
    }
43
44 8
    public function getTranslationCode(): string
45
    {
46 8
        return $this->translationCode;
47
    }
48
49 6
    public function changeTranslationCode(string $newTranslationCode): Token
50
    {
51 6
        $this->translationCode = $newTranslationCode;
52 6
        return $this;
53
    }
54
}
55