Declaratively specify how to extract elements from a JSON document, in PHP