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
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.
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 PHP8.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