LowercaseUnderscoredTokenModifier   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A modify() 0 4 1
1
<?php
2
3
namespace Efabrica\TranslationsAutomatization\TokenModifier;
4
5
use Efabrica\TranslationsAutomatization\Tokenizer\Token;
6
use Efabrica\TranslationsAutomatization\TokenModifier\TokenModifier;
7
use Nette\Utils\Strings;
8
9
class LowercaseUnderscoredTokenModifier extends TokenModifier
10
{
11 18
    protected function modify(Token $token): Token
12
    {
13 18
        $token->changeTranslationKey(str_replace('-', '_', Strings::webalize($token->getTranslationKey())));
14 18
        return $token;
15
    }
16
}
17