src/Translator/HttpTranslator.php
private function computeBody(Query $query): StringStream
    {
        $statement = [
            'statement' => $query->cypher(),
            'resultDataContents' => ['graph', 'row'],
        ];

        if ($query->hasParameters()) {
            $parameters = [];

            foreach ($query->parameters() as $parameter) {
                $parameters[$parameter->key()] = $parameter->value();
            }

            $statement['parameters'] = $parameters;
        }

        return new StringStream(Json::encode([
            'statements' => [$statement],
        ]));
    }
private function computeBody(Query $query): StringStream
    {
        $statement = [
            'statement' => $query->cypher(),
            'resultDataContents' => ['graph', 'row'],
        ];

        if ($query->hasParameters()) {
            $parameters = [];

            foreach ($query->parameters() as $parameter) {
                $parameters[$parameter->key()] = $parameter->value();
            }

            $statement['parameters'] = $parameters;
        }

        return new StringStream(Json::encode([
            'statements' => [$statement],
        ]));
    }
private function computeBody ( Query $ query ) : StringStream { $ statement = [ 'statement' => $ query -> cypher ( ) , 'resultDataContents' => [ 'graph' , 'row' ] , ] ; if ( $ query -> hasParameters ( ) ) { $ parameters = [ ] ; foreach ( $ query -> parameters ( ) as $ parameter ) { $ parameters [ $ parameter -> key ( ) ] = $ parameter -> value ( ) ; } $ statement [ 'parameters' ] = $ parameters ; } return new StringStream ( Json :: encode ( [ 'statements' => [ $ statement ] , ] ) ) ; }
Build the json payload to be sent to the server
Build the json payload to be sent to the server