for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mediumart\Orange\SMS\Http\Requests;
use Exception;
use Mediumart\Orange\SMS\Http\SMSClientRequest;
class OutboundSMSRequest extends SMSClientRequest
{
/**
* Request body
*
* @var array
*/
protected $body;
* Recipient number
* @var string
protected $sender;
* OutboundSMSObjectRequest constructor.
* @param $message
* @param $recipientNumber
* @param $senderNumber
* @param $senderName
* @throws \Exception
public function __construct($message, $recipientNumber, $senderNumber, $senderName = null)
$senderName
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function __construct($message, $recipientNumber, $senderNumber, /** @scrutinizer ignore-unused */ $senderName = null)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$this->throwsExceptionIfEmpty($recipientNumber, $senderNumber);
$this->body = ['outboundSMSMessageRequest' => [
'address' => 'tel:'.$this->normalizePhoneNumber($recipientNumber),
'senderAddress' => $this->sender = 'tel:'.$this->normalizePhoneNumber($senderNumber),
'outboundSMSTextMessage' => [ 'message' => $message ?: '']
]
];
// if ($senderName) {
// $this->body['outboundSMSMessageRequest']['senderName'] = urlencode($senderName);
// }
}
* @inherit
* @return string
public function method()
return 'POST';
public function uri()
return static::BASE_URI."/smsmessaging/v1/outbound/".urlencode($this->sender)."/requests";
* @return array
public function options()
return [
'headers' => ["Content-Type" => "Application/json"],
'body' => json_encode($this->body)
private function throwsExceptionIfEmpty($recipientNumber, $senderNumber)
if (empty($senderNumber)) {
throw new Exception('Missing Sender number');
if (empty($recipientNumber)) {
throw new Exception('Missing Recipient number');
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.