Total Complexity | 5 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | final class ArgumentResolvingException extends ResolvingException |
||
10 | { |
||
11 | use ClosureRendererTrait; |
||
|
|||
12 | |||
13 | 10 | private function __construct( |
|
14 | private readonly \ReflectionFunctionAbstract $reflection, |
||
15 | private readonly string $parameter, |
||
16 | ?string $message = null, |
||
17 | ) { |
||
18 | 10 | $message ??= "Unable to resolve required argument `{$parameter}` when resolving `%s` %s."; |
|
19 | 10 | parent::__construct($this->renderFunctionAndParameter($reflection, $message)); |
|
20 | } |
||
21 | |||
22 | 10 | public static function createWithParam(\ReflectionFunctionAbstract $reflection, string $parameter): self |
|
25 | } |
||
26 | |||
27 | 2 | public function getParameter(): string |
|
28 | { |
||
29 | 2 | return $this->parameter; |
|
30 | } |
||
31 | |||
32 | 5 | protected static function createStatic(string $message, ?\Throwable $previous): static |
|
38 | } |
||
39 | } |
||
40 |