Conditions | 5 |
Paths | 4 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 5.0073 |
Changes | 0 |
1 | <?php |
||
35 | 3 | public function send($notifiable, Notification $notification) |
|
36 | { |
||
37 | 3 | if (! $routing = $notifiable->routeNotificationFor('MailLift')) { |
|
38 | return; |
||
39 | } |
||
40 | |||
41 | 3 | $user = config('services.maillift.user'); |
|
42 | 3 | $key = config('services.maillift.key'); |
|
43 | |||
44 | 3 | if (is_null($key) || is_null($user)) { |
|
45 | 1 | throw InvalidConfiguration::configurationNotSet(); |
|
46 | } |
||
47 | |||
48 | 2 | $mailliftParameters = $notification->toMailLift($notifiable)->toArray(); |
|
|
|||
49 | |||
50 | 2 | $response = $this->client->post(self::API_ENDPOINT, [ |
|
51 | 2 | 'auth' => [$user, $key], |
|
52 | 2 | 'form_params' => Arr::set($mailliftParameters, 'Recipient', $routing), |
|
53 | 2 | ]); |
|
54 | |||
55 | 2 | if ($response->getStatusCode() !== 200) { |
|
56 | 1 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
|
57 | } |
||
58 | 1 | } |
|
59 | } |
||
60 |
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.