Total Complexity | 3 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class ServiceException extends \Exception |
||
10 | { |
||
11 | /** |
||
12 | * @param ValidationError $vError |
||
13 | * @return ServiceException |
||
14 | */ |
||
15 | public static function invalidServiceData(ValidationError $vError): ServiceException |
||
16 | { |
||
17 | $message = 'Invalid service data' . PHP_EOL |
||
18 | . 'Error of type ' . $vError->keyword() . ' at ' . implode('->', $vError->dataPointer()) . PHP_EOL |
||
19 | . json_encode($vError->keywordArgs(), JSON_PRETTY_PRINT); |
||
20 | return new self($message); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @param string $volumeType |
||
25 | * @return ServiceException |
||
26 | */ |
||
27 | public static function unknownVolumeType(string $volumeType): ServiceException |
||
28 | { |
||
29 | $message = 'Unknown service volume type: ' . $volumeType . PHP_EOL |
||
30 | . 'Expected: ' . json_encode(VolumeTypeEnum::getVolumeTypes()); |
||
31 | return new self($message); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param string $type |
||
36 | * @return ServiceException |
||
37 | */ |
||
38 | public static function unknownEnvVariableType(string $type): ServiceException |
||
43 | } |
||
44 | } |
||
45 |