Closed uuf6429 closed 2 years ago
By the way, a lot of code from that class can be removed if you make it extend \ArrayObject
.
Here's an example: https://3v4l.org/PvFLQ (works at least since PHP 5.4)
Just realised, the offsetGet
part of the problem mentioned above has been fixed in #22 (not released since 2018).
This issue has been addressed in v3.4.0. Hence closing it.
Let's take a look at
ListResult.php
.Here are the key facts:
_items
and_index
properties (by the way, underscore is unnecessary)_items
with the result recordsoffsetExists
), setting (offsetSet
) and removing (offsetUnset
) offsets affects arbitrary propertiesoffsetGet
) access the undefined/magiclist
propertycurrent
/valid
) actually works with_items
propertySo from my understand:
As I see from
lib/ChargeBee/Request.php:39
, response originally contains items insidelist
index....so to sum this all up:response
property does not contain the original response, but rather the value ofresponse['list']
offset*
methods are buggy (they either get arbitrary properties or foroffsetGet
, the non-existent 'list' property)