| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 3 | public function getParameterValue(ParameterAttributeInterface $attribute, Context $context): mixed |
|
| 22 | { |
||
| 23 | 3 | if (!$attribute instanceof Route) { |
|
| 24 | 1 | throw new UnexpectedAttributeException(Route::class, $attribute); |
|
| 25 | } |
||
| 26 | |||
| 27 | 2 | $arguments = $this->currentRoute->getArguments(); |
|
| 28 | |||
| 29 | 2 | $name = $attribute->getName(); |
|
| 30 | 2 | if ($name === null) { |
|
| 31 | 2 | return $arguments; |
|
| 32 | } |
||
| 33 | |||
| 34 | 2 | return $arguments[$name] ?? throw new NotResolvedException(); |
|
| 35 | } |
||
| 37 |