Conditions | 4 |
Paths | 4 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4.074 |
Changes | 0 |
1 | <?php |
||
34 | 2 | public function send($notifiable, Notification $notification) |
|
35 | { |
||
36 | 2 | if (! $routing = collect($notifiable->routeNotificationFor('Chabok'))) { |
|
37 | return; |
||
38 | } |
||
39 | |||
40 | 2 | $key = config('services.chabok.key'); |
|
41 | |||
42 | 2 | if (is_null($key)) { |
|
43 | 1 | throw InvalidConfiguration::configurationNotSet(); |
|
44 | } |
||
45 | |||
46 | 1 | $chabokParameters = $notification->toChabok($notifiable)->toArray(); |
|
|
|||
47 | |||
48 | 1 | $response = $this->client->post(self::$API_ENDPOINT.'?access_token='.$key, [ |
|
49 | 1 | 'form_params' => Arr::set($chabokParameters, 'user', $routing->get('uuid')), |
|
50 | ]); |
||
51 | |||
52 | 1 | if ($response->getStatusCode() !== 200) { |
|
53 | 1 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
|
54 | } |
||
55 | } |
||
56 | } |
||
57 |
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.