Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
39 | 3 | public function validateDataWithErrors($data): array |
|
40 | { |
||
41 | 3 | $isValid = $this->strategy->validate($data); |
|
42 | 3 | if ($isValid) { |
|
43 | 1 | return ['isValid' => true]; |
|
44 | } |
||
45 | |||
46 | 2 | if (method_exists($this->strategy, 'getErrors')) { |
|
47 | 1 | return [ |
|
48 | 1 | 'isValid' => false, |
|
49 | 1 | 'errors' => $this->strategy->getErrors() |
|
|
|||
50 | 1 | ]; |
|
51 | } |
||
52 | |||
53 | 1 | return ['isValid' => false]; |
|
54 | } |
||
56 |