TokenCollection   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A addToken() 0 4 1
A getFilePath() 0 3 1
A __construct() 0 3 1
A getTokens() 0 3 1
1
<?php
2
3
namespace Efabrica\TranslationsAutomatization\Tokenizer;
4
5
class TokenCollection
6
{
7
    private $filePath;
8
9
    private $tokens = [];
10
11 86
    public function __construct(string $filePath)
12
    {
13 86
        $this->filePath = $filePath;
14 86
    }
15
16 14
    public function getFilePath(): string
17
    {
18 14
        return $this->filePath;
19
    }
20
21 80
    public function addToken(Token $token)
22
    {
23 80
        $this->tokens[] = $token;
24 80
        return $this;
25
    }
26
27
    /**
28
     * @return Token[]
29
     */
30 70
    public function getTokens(): array
31
    {
32 70
        return $this->tokens;
33
    }
34
}
35