Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
ServiceLocationValidationTrait | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
validateServiceLocations | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
3 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace BO\Zmscitizenapi\Services\Availability; |
6 | |
7 | use BO\Zmscitizenapi\Services\Core\ValidationService; |
8 | |
9 | trait ServiceLocationValidationTrait |
10 | { |
11 | private function validateServiceLocations(array $officeIds, array $serviceIds): ?array |
12 | { |
13 | foreach ($officeIds as $officeId) { |
14 | $errors = ValidationService::validateServiceLocationCombination( |
15 | (int) $officeId, |
16 | array_map('intval', $serviceIds) |
17 | ); |
18 | if (!empty($errors['errors'])) { |
19 | return $errors; |
20 | } |
21 | } |
22 | |
23 | return null; |
24 | } |
25 | } |