Conditions | 6 |
Paths | 6 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 6.105 |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
20 | 32 | public function check() |
|
21 | 32 | { |
|
22 | foreach ($this->checks as $check) { |
||
23 | 32 | $checkInstance = app($check); |
|
24 | 32 | ||
25 | 32 | if (! $checkInstance instanceof HealthCheck) { |
|
26 | throw new InvalidClassException('Checks must implement Healthcheck interface.'); |
||
27 | 1 | } |
|
28 | |||
29 | $notifiers = $checkInstance->notifiers(); |
||
30 | |||
31 | if (!$checkInstance->check()) { |
||
32 | foreach ($notifiers as $notifier) { |
||
33 | app($notifier)->onFailure($checkInstance); |
||
|
|||
34 | } |
||
35 | return; |
||
36 | } else { |
||
37 | foreach ($notifiers as $notifier) { |
||
38 | app($notifier)->onSuccess($checkInstance); |
||
39 | } |
||
44 |
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.