-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
{
"classes": [
{
"type": "A",
"implements": [
{
"type": "IA"
},
{
"type": "IX"
}
]
},
{
"type": "B",
"implements": [
{
"type": "IB"
},
{
"type": "IX"
}
]
},
{
"type": "C",
"implements": []
}
]
}
$parser = \phpDocumentor\JsonPath\Parser::createInstance();
$query = $parser->parse('$.classes[?(@.implements[?(@.type == "IX")])]');
$executor = new \phpDocumentor\JsonPath\Executor();
foreach ($executor->evaluate($query, $json) as $result) {
var_dump($result);
}
results in parsing error even though the syntax is valid - works at https://jsonpath.com.
For context:
I am trying using phpdocumentor class-list directive against interface not abstract class. The code below works only on abstract classes.
.. phpdoc:class-list:: [?(@.inheritedElement == "\phpDocumentor\Transformer\Writer\WriterAbstract")]
I had dumped AST tree and trying to use implements collection defined on class metadata. But I cannot subfilter. Hence this issue.
Metadata
Metadata
Assignees
Labels
No labels