Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class CannotMapTypeException extends \Exception |
||
10 | { |
||
11 | public static function createForType(string $className): self |
||
12 | { |
||
13 | return new self('cannot map class "'.$className.'" to a known GraphQL type. Check your TypeMapper configuration.'); |
||
14 | } |
||
15 | |||
16 | public static function createForInputType(string $className): self |
||
17 | { |
||
18 | return new self('cannot map class "'.$className.'" to a known GraphQL input type. Check your TypeMapper configuration.'); |
||
19 | } |
||
20 | |||
21 | public static function wrapWithParamInfo(self $previous, \ReflectionParameter $parameter): self |
||
22 | { |
||
23 | $message = sprintf('For parameter $%s, in %s::%s, %s', |
||
24 | $parameter->getName(), |
||
25 | $parameter->getDeclaringClass()->getName(), |
||
26 | $parameter->getDeclaringFunction()->getName(), |
||
27 | $previous->getMessage()); |
||
28 | |||
29 | return new self($message, 0, $previous); |
||
30 | } |
||
31 | |||
32 | public static function wrapWithReturnInfo(self $previous, ReflectionMethod $method): self |
||
40 | } |
||
41 | } |
||
42 |