properly handle null data when denormalizing

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10794
| License       | MIT
| Doc PR        | 
Assumed that you pass an object like this:

```php
$foo = new stdClass();
$foo->bar = 'baz';
```

we can create an array which look like this:

```php
$foo = array('bar' => 'baz');
```

This way, the parsing of the constructor arguments works regardless of the type being passed as ``$data``.

For ``null`` or any other data type that cannot be iterated, this "transformed data" can simply be an empty array.