src/Tool/JSONThrowOnError.php
private function isIncludeJSONThrowOnErrorOption($node): Bool
    {
        if (!$node instanceof Node) {
            return false;
        }

        if ($node->kind === \ast\AST_CONST) {
            $name = $node->children["name"];
            if ($name->kind === \ast\AST_NAME && $name->children["name"] === "JSON_THROW_ON_ERROR") {
                return true;
            }
        }

        if ($node->kind === \ast\AST_BINARY_OP && $node->flags === \ast\flags\BINARY_BITWISE_OR) {
            return $this->isIncludeJSONThrowOnErrorOption($node->children["left"])
                     || $this->isIncludeJSONThrowOnErrorOption($node->children["right"]);
        }

        return false;
    }
private function isIncludeJSONThrowOnErrorOption($node): Bool
    {
        if (!$node instanceof Node) {
            return false;
        }

        if ($node->kind === \ast\AST_CONST) {
            $name = $node->children["name"];
            if ($name->kind === \ast\AST_NAME && $name->children["name"] === "JSON_THROW_ON_ERROR") {
                return true;
            }
        }

        if ($node->kind === \ast\AST_BINARY_OP && $node->flags === \ast\flags\BINARY_BITWISE_OR) {
            return $this->isIncludeJSONThrowOnErrorOption($node->children["left"])
                     || $this->isIncludeJSONThrowOnErrorOption($node->children["right"]);
        }

        return false;
    }
private function isIncludeJSONThrowOnErrorOption ( $ node ) : Bool { if ( ! $ node instanceof Node ) { return false ; } if ( $ node -> kind === \ ast \ AST_CONST ) { $ name = $ node -> children [ "name" ] ; if ( $ name -> kind === \ ast \ AST_NAME && $ name -> children [ "name" ] === "JSON_THROW_ON_ERROR" ) { return true ; } } if ( $ node -> kind === \ ast \ AST_BINARY_OP && $ node -> flags === \ ast \ flags \ BINARY_BITWISE_OR ) { return $ this -> isIncludeJSONThrowOnErrorOption ( $ node -> children [ "left" ] ) || $ this -> isIncludeJSONThrowOnErrorOption ( $ node -> children [ "right" ] ) ; } return false ; }
Check whether the passed node has `JSON_THROW_ON_ERROR`

This function is also aware of inclusive or.

@param mixed $node Node or others.
@return boolean Result.
Check whether the passed node has JSON_THROW_ON_ERROR