for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\SmsRu;
class SmsRuApi extends \Zelenin\SmsRu\Api
{
public function sendMessage($recipient, SmsRuMessage $message)
$sms = new \Zelenin\SmsRu\Entity\Sms($recipient, $message->content);
if ($message->time) {
$sms->time = $message->time;
}
if ($message->test) {
$sms->test = $message->test;
$test
string
$message->test
true
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.
$answer = 42; $correct = false; $correct = (bool) $answer;
if ($message->from) {
$sms->from = $message->from;
if ($message->translit) {
$sms->translit = $message->translit;
$translit
$message->translit
if ($message->partnerId) {
$sms->partner_id = $message->partnerId;
return $this->smsSend($sms);
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.