for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Epmnzava\Telerivet\Api;
use Epmnzava\Telerivet\Models\SendSmsResponse;
class TelerivetApi
{
public function sendSmsRequest(string $url,Array $data,$authorization)
$url
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$datacontent=$data["content"];
$datato=$data["to"];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.telerivet.com/v1/projects/PJe7f3e7fe7d0ddf20/messages/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"content\"\r\n\r\n$datacontent\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"to_number\"\r\n\r\n$datato\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
CURLOPT_HTTPHEADER => array(
"authorization: Basic ".$authorization,
"content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
$err
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
$myVar = 'Value'; $higher = false; if (rand(1, 6) > 3) { $higher = true; } else { $higher = false; }
Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.
$myVar
$higher
curl_close($curl);
return $response;
}
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.