neoxygen / neo4j-neoclient

Simple PHP HttpClient for the Neo4j ReST API with Multi DB Support
MIT License
121 stars 138 forks source link

throw exception when query is not a string #48

Closed Mulkave closed 9 years ago

Mulkave commented 9 years ago

Doing this doesn't warn for wrong usage:

$client = ClientBuilder::create()
    ->addConnection('default','http','dev',7575)
    ->setAutoFormatResponse(true)
    ->build();

$query = [
    'statement' => 'CREATE (individual:`Individual`) SET individual.updated_at_create = {updated_at_create}, individual.created_at_create = {created_at_create} RETURN individual',
    'parameters' => [
        'updated_at_create' => "2015-04-25 15:05:13",
        'created_at_create' => "2015-04-25 15:05:13"
    ],
];

$response = $client->sendCypherQuery($query);
$body = $response->getBody();

where it should be instead:

$response = $client->sendCypherQuery($query['statement'], $query['parameters']);
ikwattro commented 9 years ago

:+1:

ikwattro commented 9 years ago

fixed by d5821968b364bcc070a8e2a442ced3b9c603605f