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