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