AbstractNormalizer::setParams()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 4
crap 1
1
<?php
2
3
namespace kalanis\Pohoda\Common\OptionsResolver\Normalizers;
4
5
use kalanis\Pohoda\Common\Dtos\AbstractDto;
6
7
/**
8
 * Normalization of content
9
 */
10
abstract class AbstractNormalizer
11
{
12
    protected int|null $length = null;
13
    protected bool $nullable = false;
14
    protected mixed $custom = null;
15
    protected ?AbstractDto $dto = null;
16
17 158
    public function setParams(
18
        int|null $length = null,
19
        bool $nullable = false,
20
        mixed $custom = null,
21
        ?AbstractDto $dto = null,
22
    ): self {
23 158
        $this->length = $length;
24 158
        $this->nullable = $nullable;
25 158
        $this->custom = $custom;
26 158
        $this->dto = $dto;
27 158
        return $this;
28
    }
29
30
    /**
31
     * Normalize that content
32
     * @param mixed $options
33
     * @param mixed $value
34
     * @return mixed
35
     */
36
    abstract public function normalize(mixed $options, mixed $value): mixed;
37
}
38