Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class ServiceException extends \Exception |
||
10 | { |
||
11 | public static function invalidServiceData(ValidationError $vError): ServiceException |
||
12 | { |
||
13 | $message = 'Invalid service data' . PHP_EOL |
||
14 | . 'Error of type ' . $vError->keyword() . ' at ' . implode('->', $vError->dataPointer()) . PHP_EOL |
||
15 | . \GuzzleHttp\json_encode($vError->keywordArgs(), JSON_PRETTY_PRINT); |
||
16 | return new self($message); |
||
17 | } |
||
18 | |||
19 | public static function jsonSchemaNotFound(string $pathname): ServiceException |
||
20 | { |
||
21 | return new self("The Json Schema used for validate the Service is not found (at $pathname)."); |
||
22 | } |
||
23 | |||
24 | public static function unknownVolumeType(string $volumeType): ServiceException |
||
25 | { |
||
26 | $message = 'Unknown service volume type: ' . $volumeType . PHP_EOL |
||
27 | . 'Expected: ' . \GuzzleHttp\json_encode(VolumeTypeEnum::getVolumeTypes()); |
||
28 | return new self($message); |
||
29 | } |
||
30 | |||
31 | public static function unknownEnvVariableType(string $type): ServiceException |
||
36 | } |
||
37 | } |
||
38 |