| Conditions | 7 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 7.0178 |
| Changes | 7 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 3 | public function bootCallProxies(?string $method = null): void |
|
| 24 | { |
||
| 25 | 3 | $reflection = new \ReflectionClass(static::class); |
|
| 26 | |||
| 27 | 3 | $method = is_null($method) |
|
| 28 | 3 | ? $reflection->getConstructor() |
|
| 29 | : $reflection->getMethod($method); |
||
| 30 | |||
| 31 | 3 | $dependencies = $method->getParameters(); |
|
|
|
|||
| 32 | |||
| 33 | 3 | if (! empty($dependencies)) { |
|
| 34 | 3 | $this->proxy = new Fluent(); |
|
| 35 | |||
| 36 | 3 | collect($dependencies)->map(function ($param) { |
|
| 37 | 3 | $class = $param->getType()->getName(); |
|
| 38 | |||
| 39 | 3 | if (class_exists($class) || interface_exists($class)) { |
|
| 40 | 3 | property_exists(static::class, $param->getName()) && is_object($this->{$param->getName()}) |
|
| 41 | 2 | ? $this->proxy->{$param->getName()} = call($this->{$param->getName()}) |
|
| 42 | 1 | : $this->proxy->{$param->getName()} = call($class); |
|
| 43 | } |
||
| 48 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.