Conditions | 6 |
Paths | 32 |
Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public function sendMessage($recipient, SmsRuMessage $message) |
||
10 | { |
||
11 | $sms = new \Zelenin\SmsRu\Entity\Sms($recipient, $message->content); |
||
12 | |||
13 | if ($message->time) { |
||
14 | $sms->time = $message->time; |
||
15 | } |
||
16 | |||
17 | if ($message->test) { |
||
18 | $sms->test = $message->test; |
||
|
|||
19 | } |
||
20 | |||
21 | if ($message->from) { |
||
22 | $sms->from = $message->from; |
||
23 | } |
||
24 | |||
25 | if ($message->translit) { |
||
26 | $sms->translit = $message->translit; |
||
27 | } |
||
28 | |||
29 | if ($message->partnerId) { |
||
30 | $sms->partner_id = $message->partnerId; |
||
31 | } |
||
32 | |||
33 | return $this->smsSend($sms); |
||
34 | } |
||
35 | } |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.