| Conditions | 8 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 8 |
| Changes | 8 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 5 | public function bootCallProxies(?string $method = null): void |
|
| 24 | { |
||
| 25 | 5 | $reflection = new \ReflectionClass(static::class); |
|
| 26 | |||
| 27 | 5 | $method = is_null($method) |
|
| 28 | 4 | ? $reflection->getConstructor() |
|
| 29 | 2 | : $reflection->getMethod($method); |
|
| 30 | |||
| 31 | 5 | $dependencies = $method->getParameters(); |
|
|
|
|||
| 32 | |||
| 33 | 5 | if (! empty($dependencies)) { |
|
| 34 | 5 | if (! $this->proxy instanceof Fluent) { |
|
| 35 | 5 | $this->proxy = new Fluent(); |
|
| 36 | } |
||
| 37 | |||
| 38 | 5 | collect($dependencies)->map(function ($param) { |
|
| 39 | 5 | $class = $param->getType()->getName(); |
|
| 40 | |||
| 41 | 5 | if (class_exists($class) || interface_exists($class)) { |
|
| 42 | 5 | property_exists(static::class, $param->getName()) && is_object($this->{$param->getName()}) |
|
| 43 | 3 | ? $this->proxy->{$param->getName()} = call($this->{$param->getName()}) |
|
| 44 | 3 | : $this->proxy->{$param->getName()} = call($class); |
|
| 45 | } |
||
| 50 |
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.