Skip to content

README contains invalid code #27

@tim-hitchins-ekkosense

Description

@tim-hitchins-ekkosense

The section Selecting part of a JSON document contains the snippet:

// Selecting all 'a' properties (indefinite query, values exist):
$query1 = $queryFactory->createQuery('$..a');
$result1 = $processor->select($query1, $document);
var_dump($result1->select()); // array: ['{"a":1,"b":2}', '1']

I believe this should be $result1->decode(). A SelectResult has no method select.

https://github.com/remorhaz/php-json-path?tab=readme-ov-file#selecting-part-of-a-json-document

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions