doctrine / DoctrineMongoDBBundle

Integrates Doctrine MongoDB ODM with Symfony
http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
MIT License
379 stars 229 forks source link

UniqueEntity::$service is considered final #741

Closed IonBazan closed 9 months ago

IonBazan commented 2 years ago

Running a test suite in a Symfony 6.1 application throws a deprecation notice:

The "Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity::$service" property is considered final. You should not override it in "Doctrine\Bundle\MongoDBBundle\Validator\Constraints\Unique".

This is because Doctrine\Bundle\MongoDBBundle\Validator\Constraints\Unique class overrides $service property with a different default value.

Another way to override it would be to copy the constructor parameters and set the default value there.

https://github.com/doctrine/DoctrineMongoDBBundle/blob/4.6.x/Validator/Constraints/Unique.php

franmomu commented 9 months ago

Fixed in https://github.com/doctrine/DoctrineMongoDBBundle/pull/777