for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\PanaceaMobile;
use Illuminate\Contracts\Support\Arrayable;
class PanaceaMobileMessage implements Arrayable
{
/**
* The phone number the message should be sent from.
*
* @var string
*/
public $from;
* The message content.
public $content;
* Create a new message instance.
* @param string $content
* @return static
public static function create($content = '')
return new static($content);
}
public function __construct($content = '')
$this->content = $content;
* Set the message content.
* @return $this
public function content($content)
return $this;
* Set the phone number or from name the message should be sent from.
* @param string $from
public function from($from)
$this->from = $from;
$from
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
public function recipient($to)
$this->to = $to;
to
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
* @return array
public function toArray()
$params = [
'text' => $this->content,
'charset' => 'utf-8',
];
if (! empty($this->from)) {
$params = array_merge($params, ['from' => $this->from]);
return $params;
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.