| Conditions | 5 |
| Paths | 6 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5.0113 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 12 | public function resolve($name) |
|
| 26 | { |
||
| 27 | 12 | $value = $this->registrations[$name]; |
|
| 28 | |||
| 29 | 12 | if (is_string($value)) { |
|
| 30 | // Check for `class@method` format. |
||
| 31 | 12 | if (strpos($value, '@') >= 1) { |
|
| 32 | 4 | $segments = explode('@', $value, 2); |
|
| 33 | |||
| 34 | 4 | if ($this->container->bound($segments[0])) { |
|
| 35 | return [ |
||
| 36 | 4 | $this->container->make($segments[0]), $segments[1], |
|
| 37 | 3 | ]; |
|
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | 8 | if ($this->container->bound($name)) { |
|
| 42 | 4 | return $this->container->make($name); |
|
| 43 | } |
||
| 44 | 3 | } |
|
| 45 | |||
| 46 | 4 | return parent::resolve($name); |
|
| 47 | } |
||
| 48 | } |
||
| 49 |