| Total Complexity | 6 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class TemplateCanNotBeExpanded extends \InvalidArgumentException implements UriTemplateException |
||
| 19 | { |
||
| 20 | 6 | public static function dueToMalformedExpression(string $template): self |
|
| 21 | { |
||
| 22 | 6 | return new self('The submitted template "'.$template.'" contains invalid expressions.'); |
|
| 23 | } |
||
| 24 | |||
| 25 | 48 | public static function dueToMalformedVariableSpecification(string $varSpec, string $expression): self |
|
| 26 | { |
||
| 27 | 48 | $message = 'The variable specification "'.$varSpec.'" included in the expression "{'.$expression.'}" is invalid.'; |
|
| 28 | 48 | if ('' === $varSpec) { |
|
| 29 | 2 | $message = 'No variable specification was included in the expression "{'.$expression.'}".'; |
|
| 30 | } |
||
| 31 | |||
| 32 | 48 | return new self($message); |
|
| 33 | } |
||
| 34 | |||
| 35 | 6 | public static function dueToUsingReservedOperator(string $expression): self |
|
| 36 | { |
||
| 37 | 6 | return new self('The operator used in the expression "{'.$expression.'}" is reserved.'); |
|
| 38 | } |
||
| 39 | |||
| 40 | 4 | public static function dueToUnableToProcessValueListWithPrefix(string $variableName): self |
|
| 41 | { |
||
| 42 | 4 | return new self('The ":" modifier can not be applied on "'.$variableName.'" since it is a list of values.'); |
|
| 43 | } |
||
| 44 | |||
| 45 | 2 | public static function dueToNestedListOfValue(string $variableName): self |
|
| 48 | } |
||
| 49 | } |
||
| 50 |