Conditions | 6 |
Paths | 15 |
Total Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 6.0585 |
Changes | 0 |
1 | <?php |
||
26 | 7 | public function send($notifiable, Notification $notification) |
|
27 | { |
||
28 | 7 | if (! $faxNumber = $notifiable->routeNotificationFor('interfax')) { |
|
29 | 1 | return; |
|
30 | } |
||
31 | |||
32 | 6 | $message = $notification->toInterfax($notifiable); |
|
|
|||
33 | |||
34 | try { |
||
35 | 6 | $fax = $this->client->deliver([ |
|
36 | 6 | 'faxNumber' => $faxNumber, |
|
37 | 6 | 'files' => $message->makeFiles(), |
|
38 | ]); |
||
39 | |||
40 | 6 | if ($message->shouldCheckStatus()) { |
|
41 | 2 | $message->sleep(); |
|
42 | |||
43 | 2 | while ($fax->refresh()->status < 0) { |
|
44 | 1 | $message->sleep(); |
|
45 | } |
||
46 | |||
47 | 2 | if ($fax->refresh()->status > 0) { |
|
48 | 6 | throw CouldNotSendNotification::serviceRespondedWithAnError($message, $fax->refresh()->attributes()); |
|
49 | } |
||
50 | } |
||
51 | 1 | } catch (\Interfax\Exception\RequestException $e) { |
|
52 | $exceptionMessage = $e->getMessage().': '.($e->getWrappedException())->getMessage(); |
||
53 | throw CouldNotSendNotification::serviceRespondedWithAnError($message, $fax->refresh()->attributes(), $exceptionMessage); |
||
54 | } |
||
55 | 5 | } |
|
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.