1 | <?php declare(strict_types=1); |
||
26 | class Error implements ErrorInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var string|null |
||
30 | */ |
||
31 | private $name; |
||
32 | |||
33 | /** |
||
34 | * @var mixed |
||
35 | */ |
||
36 | private $value; |
||
37 | |||
38 | /** |
||
39 | * @var int |
||
40 | */ |
||
41 | private $code; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | private $messageTemplate; |
||
47 | |||
48 | /** |
||
49 | * @var array|null |
||
50 | */ |
||
51 | private $messageParams; |
||
52 | |||
53 | /** |
||
54 | * @param null|string $name |
||
55 | * @param mixed $value |
||
56 | * @param int $code |
||
57 | * @param string $messageTemplate |
||
58 | * @param array $messageParams |
||
59 | */ |
||
60 | 17 | public function __construct(?string $name, $value, int $code, string $messageTemplate, array $messageParams) |
|
70 | |||
71 | /** |
||
72 | * @inheritdoc |
||
73 | */ |
||
74 | 12 | public function getParameterName(): ?string |
|
78 | |||
79 | /** |
||
80 | * @inheritdoc |
||
81 | */ |
||
82 | 4 | public function getParameterValue() |
|
86 | |||
87 | /** |
||
88 | * @inheritdoc |
||
89 | */ |
||
90 | 8 | public function getMessageCode(): int |
|
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | 1 | public function getMessageTemplate(): string |
|
102 | |||
103 | /** |
||
104 | * @inheritdoc |
||
105 | */ |
||
106 | 4 | public function getMessageParameters(): array |
|
110 | |||
111 | /** |
||
112 | * @param iterable $messageParams |
||
113 | * |
||
114 | * @return bool |
||
115 | */ |
||
116 | 17 | protected function checkEachValueConvertibleToString(iterable $messageParams): bool |
|
130 | } |
||
131 |
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: