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

PHP 8.4 Deprecation warnings #237

Open Chaxiraxi opened 1 week ago

Chaxiraxi commented 1 week ago

I know PHP 8.4 is not fully supported/tested yet, so I changed PHP version from 8.4 to 8.3 in my Dockerfile, and there's no warnings anymore. Anyway, this issue is just to raise some concerns for the future as there are a tons of deprecation warnings when making a simple run request. Here's my code:

function getAllOwnedProducts($client) {
    $query = "MATCH (:User)-->(:Ownership)-->(p:Product) RETURN p";
    $result = $client->run($query);

    $products = [];
    foreach ($result as $record) {
        $product = $record->get('p');
        $name = $product->getProperty('name');
        $product_id = $product->getProperty('product_id');

        $products[] = [
            'name' => $name,
            'product_id' => $product_id
        ];
    }

    return json_encode($products);
}

echo getAllOwnedProducts($client);
header('Content-Type: application/json');

The output:

<br />
<b>Deprecated</b>:  Laudis\Neo4j\Databags\HttpPsrBindings::__construct(): Implicitly marking parameter $streamFactory as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Databags/HttpPsrBindings.php</b> on line <b>50</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Databags\HttpPsrBindings::__construct(): Implicitly marking parameter $requestFactory as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Databags/HttpPsrBindings.php</b> on line <b>50</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Databags\HttpPsrBindings::create(): Implicitly marking parameter $client as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Databags/HttpPsrBindings.php</b> on line <b>64</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Databags\HttpPsrBindings::create(): Implicitly marking parameter $streamFactory as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Databags/HttpPsrBindings.php</b> on line <b>64</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Databags\HttpPsrBindings::create(): Implicitly marking parameter $requestFactory as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Databags/HttpPsrBindings.php</b> on line <b>64</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\DriverFactory::create(): Implicitly marking parameter $formatter as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/DriverFactory.php</b> on line <b>48</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\DriverFactory::createBoltDriver(): Implicitly marking parameter $formatter as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/DriverFactory.php</b> on line <b>79</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\DriverFactory::createNeo4jDriver(): Implicitly marking parameter $formatter as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/DriverFactory.php</b> on line <b>99</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\DriverFactory::createHttpDriver(): Implicitly marking parameter $formatter as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/DriverFactory.php</b> on line <b>121</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Neo4j\Neo4jDriver::create(): Implicitly marking parameter $formatter as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Neo4j/Neo4jDriver.php</b> on line <b>71</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Common\GeneratorHelper::getReturnFromGenerator(): Implicitly marking parameter $timeout as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Common/GeneratorHelper.php</b> on line <b>33</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Neo4j\RoutingTable::getWithRole(): Implicitly marking parameter $role as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Neo4j/RoutingTable.php</b> on line <b>48</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Bolt\Session::openTransaction(): Implicitly marking parameter $statements as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Bolt/Session.php</b> on line <b>79</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Types\Map::ksorted(): Implicitly marking parameter $comparator as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Types/Map.php</b> on line <b>189</b><br />
<br />
<b>Deprecated</b>:  Laudis\Neo4j\Types\AbstractCypherSequence::slice(): Implicitly marking parameter $length as nullable is deprecated, the explicit nullable type must be used instead in <b>/var/www/html/vendor/laudis/neo4j-php-client/src/Types/AbstractCypherSequence.php</b> on line <b>251</b><br />
exaby73 commented 6 days ago

Hey @Chaxiraxi. Thanks for pointing this one out :). I have created a PR which we will merge soon and be available in the next release before 8.4 officially is available. If you find any other deprecation warnings, please do open a new issue