`attributesToArray` can handle instances of `ArrayableInterface`

basically some mutators can return instances of `ArrayableInterface`, and this case is not handled by `attributesToArray`, so put that condition in there
removed syntax error
Merge pull request #4301 from kapv89/patch-8

`attributesToArray` can handle instances of `ArrayableInterface`