Galbar / JsonPath-PHP

A JsonPath implementation in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Absence of getArray() function

khageshsaini opened this issue · comments

There is no function getArray() present in JsonObject class. All the subsequent usage of this function result in error.

*
* // get the PHP array representation
* $obj->getArray();
*

It should be included in the class or the usage of this function in readme should be stripped off.

Hi @khageshsaini, nice catch!
Actually the function getValue() does exist and does exactly that.

This function, on the other hand may be interesting when #24 is done, as the internal representation will not be an array and therefore getValue() would make no sense to have (what value? the object representation? the array representation? the internal representation? etc.)

As of this issue, I'd say use getValue() for now. I'll update the docs changing getArray() for getValue().

Closing this as it is not a real issue with the current implementation, just docs being wrong (which are fixed now)