for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\Chabok;
class ChabokMessage
{
/** @var string */
protected $user;
protected $content;
/** @var array*/
protected $data;
/**
* @param string $user
* @return static
*/
public static function create($user = '')
return new static($user);
$user
string
array
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
}
* @param array $user
public function __construct($user = [])
$this->user = $user;
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
* Set the user.
*
* @param $user
* @return $this
public function user($user)
return $this;
* Set the content.
* @param $content
public function content($content)
$this->content = $content;
* Set the data.
* @param array $data
public function data($data)
$this->data = $data;
* @return array
public function toArray()
return [
'user' => $this->user,
'content' => $this->content,
'data' => $this->data,
];
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: