Conditions | 3 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function send(NotifiableInterface $recipient, NotificationInterface $notification) |
||
44 | { |
||
45 | /** @var SmsMessage $message */ |
||
46 | $message = $notification->exportFor('sms'); |
||
47 | $data = [ |
||
|
|||
48 | 'From' => isset($message->from) ? $message->from : $this->from, |
||
49 | 'To' => $recipient->routeNotificationFor('sms'), |
||
50 | 'Body' => $message->body |
||
51 | ]; |
||
52 | if (isset($message->mediaUrl)) { |
||
53 | $data['MedialUrl'] = $message->mediaUrl; |
||
54 | } |
||
55 | $this->httpClient |
||
56 | ->createRequest() |
||
57 | ->setMethod('post') |
||
58 | ->setUrl($this->getUri()) |
||
59 | ->addHeaders(['Authorization' => 'Basic ' . base64_encode("{$this->accountSid}:{$this->authToken}")]) |
||
60 | ->setData($data) |
||
61 | ->send(); |
||
62 | } |
||
63 | |||
64 | } |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.