CompositeTokenModifier   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 16
c 0
b 0
f 0
rs 10
ccs 7
cts 7
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addTokenModifier() 0 4 1
A modifyAll() 0 6 2
1
<?php
2
3
namespace Efabrica\TranslationsAutomatization\TokenModifier;
4
5
use Efabrica\TranslationsAutomatization\Tokenizer\TokenCollection;
6
7
class CompositeTokenModifier implements TokenModifierInterface
8
{
9
    private $tokenModifiers = [];
10
11 10
    public function addTokenModifier(TokenModifierInterface $tokenModifier)
12
    {
13 10
        $this->tokenModifiers[] = $tokenModifier;
14 10
        return $this;
15
    }
16
17 12
    public function modifyAll(TokenCollection $tokenCollection): TokenCollection
18
    {
19 12
        foreach ($this->tokenModifiers as $tokenModifier) {
20 8
            $tokenCollection = $tokenModifier->modifyAll($tokenCollection);
21
        }
22 12
        return $tokenCollection;
23
    }
24
}
25