I'm following the tutorial provided by graphaware, and I keep getting the following error while just trying to perform the basic usage tutorial:
Fatal error: Declaration of GraphAware\Neo4j\Client\HttpDriver\Session::run() must be compatible with GraphAware\Common\Driver\SessionInterface::run($statement, array $parameters = Array, $tag = NULL) in C:\ProgramData\ComposerSetup\bin\vendor\graphaware\neo4j-php-client\src\HttpDriver\Session.php on line 24
This is the code I'm executing:
<?php
require_once 'C:\ProgramData\ComposerSetup\bin\vendor\autoload.php';
use GraphAware\Neo4j\Client\ClientBuilder;
$client = ClientBuilder::create()
->addConnection('default', 'http://neo4j:password@localhost:7474') // Changed the login info back to default
->addConnection('bolt', 'bolt://neo4j:password@localhost:7687') // Changed the login info back to default
->build();
$result = $client->run("MATCH (n:User) RETURN n");
?>
I've tried removing and readding the Neo4J PHP client multiple times, but this does not fix it
I'm using Neo4J v3.0.6 and have had this same problem for days. Any help is appreciated.
EDIT: composer.json
{
"require": {
"everyman/neo4jphp": "dev-master",
"graphaware/neo4j-php-client": "4.0"
}
}
I had the same problem and "solved" it but with a suboptimal solution:
Directly (!) in GraphAware\Common\Driver\SessionInterface, I tried to replace
by
which seems to be what is expected by Graphaware\Neo4j\Client\HttpDriver\Session
And it works... for now (until package update?)
Could that be a bug?