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

Token::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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