doctrine / mongodb-odm

The Official PHP MongoDB ORM/ODM
https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/
MIT License
1.09k stars 504 forks source link

Running `odm:schema:update` produces deprecation warning #2454

Closed ivan-wolf closed 2 years ago

ivan-wolf commented 2 years ago

Running odm:schema:update (https://github.com/doctrine/mongodb-odm/blob/2.4.x/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/UpdateCommand.php) on PHP 8.1.8 produces the following warning:

Deprecated: Return type of MongoDB\Model\IndexInfoIteratorIterator::current() should either be compatible with IteratorIterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/mongodb/mongodb/src/Model/IndexInfoIteratorIterator.php on line 60

malarzm commented 2 years ago

The class causing the deprecation you're seeing comes from the MongoDB's library, as the error's filepath is pointing. From what I can tell the #[ReturnTypeWillChange] is already there so probably you just need to update your dependencies.