Total Complexity | 6 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
6 | class Validator |
||
7 | { |
||
8 | /** |
||
9 | * @var ValidationStrategy |
||
10 | */ |
||
11 | private ValidationStrategy $strategy; |
||
12 | |||
13 | /** |
||
14 | * @param ValidationStrategy $strategy |
||
15 | */ |
||
16 | 5 | public function __construct(ValidationStrategy $strategy) |
|
17 | { |
||
18 | 5 | $this->strategy = $strategy; |
|
19 | } |
||
20 | |||
21 | /** |
||
22 | * @param ValidationStrategy $strategy |
||
23 | * @return void |
||
24 | */ |
||
25 | 1 | public function setValidationStrategy(ValidationStrategy $strategy): void |
|
26 | { |
||
27 | 1 | $this->strategy = $strategy; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param $data |
||
32 | * @return mixed |
||
33 | */ |
||
34 | 1 | public function validateData($data): mixed |
|
37 | } |
||
38 | |||
39 | 3 | public function validateDataWithErrors($data): array |
|
56 |