neo4j-php / neo4j-php-client

Php client and driver for neo4j database
https://neo4j.com/developer/php/
MIT License
161 stars 40 forks source link

Fatal Error encountered due to return type incompatibility of implementing class function #182

Closed dataskills closed 1 year ago

dataskills commented 1 year ago

Describe the bug Return type of Laudis\Neo4j\Types\AbstractCypherObject::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

To Reproduce Steps to reproduce the behavior:

  1. Create client with neo4j scheme
  2. Run a simple cypher query , i.e $client->run("CREATE (n:Person {name: 'Bob'}) RETURN id(n)");
  3. See error

Expected behavior No error occurrence

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Adding the #[\ReturnTypeWillChange] successfully supresses the error

transistive commented 1 year ago

Hello @dataskills,

Thank you for posting this issue.

Can you please update to the latest version to confirm the issue persists?

It should be solved in later releases.

Thanks!

Ghlen

dataskills commented 1 year ago

Forgive me if I am missing something but I thought 2.8.0 was the latest version.

dataskills commented 1 year ago

Sorry, I see 2.8.1, I will try it

dataskills commented 1 year ago

To clarify, 2.8.0 is the latest release which has the error, but the error is fixed at tag 2.8.1. I tried to check out the tag at 2.8.3 just to compare and I figured out that the error is present in 2.8.3 but, again, is not present in 2.8.1. I think I found the cause, consider the change in src/Types/AbstractCypherObject.php in this particular diff: https://github.com/neo4j-php/neo4j-php-client/compare/2.8.1...2.8.3

I am not sure what the release roadmap is, and I know you must be busy but let us know if you can how you plan to proceed if you can. Have a great weekend, Cheers.

transistive commented 1 year ago

Hello @dataskills, it should be fixed in version 3.0.4 Feel free to reopen if this is not the case.