| 1 | <?php |
||
| 9 | class CountryCode implements Rule |
||
| 10 | { |
||
| 11 | /** @var bool */ |
||
| 12 | protected $required; |
||
| 13 | |||
| 14 | /** @var string */ |
||
| 15 | protected $attribute; |
||
| 16 | 24 | ||
| 17 | public function __construct(bool $required = true) |
||
| 21 | 6 | ||
| 22 | public function nullable(): self |
||
| 28 | 24 | ||
| 29 | public function passes($attribute, $value): bool |
||
| 41 | 12 | ||
| 42 | public function message(): string |
||
| 48 | } |
||
| 49 |
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: