It seems like $data of type array is incompatible with the declared type object of property $data.