Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5.0113 |
Changes | 0 |
1 | <?php |
||
30 | 3 | public function send($notifiable, Notification $notification) |
|
31 | { |
||
32 | 3 | $zendeskParameters = $notification->toZendesk($notifiable)->toArray(); |
|
1 ignored issue
–
show
|
|||
33 | |||
34 | 3 | if (!isset($zendeskParameters['requester']['name']) or $zendeskParameters['requester']['name'] ==='') { |
|
35 | 1 | $routing = collect($notifiable->routeNotificationFor('Zendesk')); |
|
36 | 1 | if (! Arr::has($routing, ['name', 'email'])) { |
|
37 | return; |
||
38 | } |
||
39 | |||
40 | 1 | $zendeskParameters['requester']['name'] = $routing['name']; |
|
41 | 1 | $zendeskParameters['requester']['email'] = $routing['email']; |
|
42 | 1 | } |
|
43 | |||
44 | 3 | $response = $this->client->tickets()->create($zendeskParameters); |
|
45 | |||
46 | 3 | if ($response->getStatusCode() !== 200) { |
|
47 | 1 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
|
48 | } |
||
49 | 2 | } |
|
50 | } |
||
51 |
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.