Booleans   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B normalize() 0 6 7
1
<?php
2
3
namespace Riesenia\Pohoda\Common\OptionsResolver\Normalizers;
4
5
class Booleans extends AbstractNormalizer
6
{
7 40
    public function normalize(mixed $options, mixed $value): string
8
    {
9 40
        if ($this->nullable && empty($value) && !\is_bool($value)) {
10 1
            return '';
11
        }
12 40
        return !$value || \is_string($value) && 'false' === \strtolower($value) ? 'false' : 'true';
13
    }
14
}
15