| 1 | <?php |
||
| 5 | class ChabokMessage |
||
| 6 | { |
||
| 7 | /** @var string */ |
||
| 8 | protected $user; |
||
| 9 | |||
| 10 | /** @var string */ |
||
| 11 | protected $content; |
||
| 12 | |||
| 13 | /** @var array*/ |
||
| 14 | protected $data; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param string $user |
||
| 18 | * @return static |
||
| 19 | */ |
||
| 20 | 1 | public static function create($user = '') |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @param array $user |
||
| 27 | */ |
||
| 28 | 6 | public function __construct($user = []) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * Set the user. |
||
| 35 | * |
||
| 36 | * @param $user |
||
| 37 | * |
||
| 38 | * @return $this |
||
| 39 | */ |
||
| 40 | 1 | public function user($user) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Set the content. |
||
| 49 | * |
||
| 50 | * @param $content |
||
| 51 | * |
||
| 52 | * @return $this |
||
| 53 | */ |
||
| 54 | 2 | public function content($content) |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Set the data. |
||
| 63 | * |
||
| 64 | * @param array $data |
||
| 65 | * |
||
| 66 | * @return $this |
||
| 67 | */ |
||
| 68 | 2 | public function data($data) |
|
| 74 | |||
| 75 | /** |
||
| 76 | * @return array |
||
| 77 | */ |
||
| 78 | 6 | public function toArray() |
|
| 86 | } |
||
| 87 |
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: