Completed
Push — master ( 5f6191...cd27f7 )
by Changwan
02:35
created

SanitizerNormalizer::normalize()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 2
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 3
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Sanitizer;
3
4
use Wandu\Validator\ValidatorNormalizer;
5
6
class SanitizerNormalizer extends ValidatorNormalizer
7
{
8
    /**
9
     * {@inheritdoc}
10
     */
11 2
    public function normalize($rule): array
12
    {
13 2
        if (is_string($rule) && class_exists($rule)) {
14 1
            $rule = (new $rule)->rule();
15
        }
16 2
        return parent::normalize($rule);
17
    }
18
}
19