Treats stdClass as array

Clearer than https://github.com/schmittjoh/serializer/pull/51 .