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