I have simple form, which collects: name, city, street and post_code. These are rules that I have:
return [
[['city', 'street', 'name'], 'string', 'max' => 255],
[['post_code'], 'string', 'max' => 6],
['post_code', 'match', 'pattern' => '/^([0-9]{2})(-[0-9]{3})?$/i'],
[['name', 'city', 'post_code', 'street'] => 'required']
];
It returns me error "Illegal offset type" and marks first line to be faulty, but when I comment the last line, it works fine (but of course doesn't require values to be written). What can it be caused by?