CustomCallback   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 6 3
1
<?php
2
3
namespace kalanis\Pohoda\Common\OptionsResolver\Normalizers;
4
5
final class CustomCallback extends AbstractNormalizer
6
{
7 22
    public function normalize(mixed $options, mixed $value): mixed
8
    {
9 22
        if (empty($this->custom) || !is_callable($this->custom)) {
10 1
            return '';
11
        }
12 22
        return \call_user_func($this->custom, $options, $value, $this->dto);
13
    }
14
}
15