Completed
Push — master ( 00c88c...56f5c3 )
by Rémi
13s
created

KeySanitizer::clean()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Lbc\Filter;
4
5
use Lbc\Helper\Encoding;
6
7
class KeySanitizer implements SanitizerInterface
8
{
9 10
    public static function clean($value)
10
    {
11 10
        return preg_replace(
12 10
            '/\s/',
13 10
            '_',
14 10
            trim(strtolower(Encoding::toAscii($value)))
15 10
        );
16
    }
17
}
18