for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\FortySixElks;
use NotificationChannels\FortySixElks\Exceptions\CouldNotSendNotification;
class FortySixElksSMS extends FortySixElksMedia implements FortySixElksMediaInterface
{
const ENDPOINT = 'https://api.46elks.com/a1/SMS';
public $type = 'SMS';
/**
* FortySixElksSMS constructor.
*/
public function __construct()
return parent::__construct();
parent::__construct()
NotificationChannels\For...lksMedia::__construct()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
}
* @return $this
public function send()
try {
$response = $this->client->request('POST', self::ENDPOINT, [
$response
'form_params' => [
'from' => $this->from,
'message' => $this->getContent(),
'to' => $this->phone_number,
'flashsms' => (isset($this->payload['flash']) && $this->payload['flash']) ? 'yes' : 'no',
],
]);
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
$response = $e->getResponse();
throw CouldNotSendNotification::serviceRespondedWithAnError(
$response->getBody()->getContents(),
$response->getStatusCode()
);
return $this;
public function flash()
$this->payload['flash'] = true;
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.