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

SanitizerNormalizer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 7 3
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