| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 42 | 1 | public function __invoke($name) |
|
| 43 | { |
||
| 44 | 1 | if (! is_string($name)) { |
|
| 45 | 1 | return $name; // nothing to resolve (may be a closure or other callable middleware object) |
|
| 46 | } |
||
| 47 | |||
| 48 | 1 | if ($this->container->has($name)) { |
|
| 49 | 1 | return $this->container->get($name); |
|
| 50 | } |
||
| 51 | |||
| 52 | 1 | throw new RuntimeException("unable to resolve middleware component name: {$name}"); |
|
| 53 | } |
||
| 54 | } |
||
| 55 |