CustomCallback::normalize()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 3
nc 2
nop 2
crap 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