Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 13.6948 |
Changes | 0 |
1 | <?php |
||
30 | 3 | public function send($notifiable, Notification $notification) |
|
31 | { |
||
32 | 3 | $twitterMessage = $notification->toTwitter($notifiable); |
|
|
|||
33 | if (is_a($twitterMessage, TwitterStatusUpdate::class) && $twitterMessage->getImagePaths()) { |
||
34 | $this->twitter->setTimeouts(10, 15); |
||
35 | |||
36 | $twitterMessage->imageIds = $twitterMessage->getImagePaths()->map(function ($path) { |
||
37 | $media = $this->twitter->upload('media/upload', ['media' => $path]); |
||
38 | |||
39 | return $media->media_id_string; |
||
40 | }); |
||
41 | } |
||
42 | |||
43 | $this->twitter->post($twitterMessage->getApiEndpoint(), $twitterMessage->getRequestBody()); |
||
44 | |||
45 | if ($this->twitter->getLastHttpCode() !== 200) { |
||
46 | throw CouldNotSendNotification::serviceRespondedWithAnError($this->twitter->getLastBody()); |
||
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.