We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 38 | public function apply($input): Result |
|
| 47 | { |
||
| 48 | 38 | $validCount = 0; |
|
| 49 | 38 | $childrenResults = []; |
|
| 50 | 38 | foreach ($this->rules as $key => $rule) { |
|
| 51 | 34 | $childResult = $rule->apply($input); |
|
| 52 | |||
| 53 | 34 | $childrenResults[$key] = $childResult; |
|
| 54 | |||
| 55 | 34 | if (!$childResult->isValid()) { |
|
| 56 | 25 | continue; |
|
| 57 | } |
||
| 58 | |||
| 59 | 26 | if ($validCount >= 1) { |
|
| 60 | 10 | $childrenResults[$key] = $childResult->invert(); |
|
| 61 | } |
||
| 62 | |||
| 63 | 26 | ++$validCount; |
|
| 64 | } |
||
| 65 | |||
| 66 | 38 | return new Result(($validCount === 1), $input, $this, [], ...$childrenResults); |
|
| 67 | } |
||
| 68 | } |
||
| 69 |