Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UniqueEntity::$service is considered final #741

Closed
IonBazan opened this issue Aug 1, 2022 · 1 comment · Fixed by #777
Closed

UniqueEntity::$service is considered final #741

IonBazan opened this issue Aug 1, 2022 · 1 comment · Fixed by #777

Comments

@IonBazan
Copy link
Member

IonBazan commented Aug 1, 2022

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
Copy link
Contributor

Fixed in #777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants