fixed adapter undefined indexes and illegal string offsets

Adapter `$params` must be array, otherwise we get lots of php `undefined index` and `illegal string offset` errors.
This patch fix that.

best,
FA