-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
Description
The iterator on StandardObject
does not recognise stdClass
(as it is not a traversable).
This means whenever iterating over a standard object, it is always turned into an array. The problem here is that this means any nested objects are also converted into arrays, so the iteration value is not as expected.
See here:
https://github.com/cloudcreativity/json-api/blob/master/src/Object/StandardObject.php#L89-L96
It would be better to iterate, probably using a generator, and any values that are objects should be wrapped in a standard object. I.e. keep it consistent that objects are cast to the standard object interface.
This fix will however be breaking as it could have unintended consequences on existing code.