| Conditions | 4 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function send($notifiable, Notification $notification) |
||
| 32 | { |
||
| 33 | if (! $url = $notifiable->routeNotificationFor('Webhook')) { |
||
| 34 | return; |
||
| 35 | } |
||
| 36 | |||
| 37 | $webhookData = $notification->toWebhook($notifiable)->toArray(); |
||
|
|
|||
| 38 | |||
| 39 | $response = $this->client->post($url, [ |
||
| 40 | 'body' => json_encode(Arr::get($webhookData, 'data')), |
||
| 41 | 'verify' => false, |
||
| 42 | 'headers' => Arr::get($webhookData, 'headers'), |
||
| 43 | ]); |
||
| 44 | |||
| 45 | if ($response->getStatusCode() >= 300 || $response->getStatusCode() < 200) { |
||
| 46 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 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.