-
Notifications
You must be signed in to change notification settings - Fork 231
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
fix: UniqueEntity::$service is considered final #777
Conversation
Thanks @divine! what about using the suggested approach by symfony:
That way a user can use |
Does it look better now? Thanks! |
Co-authored-by: Fran Moreno <franmomu@gmail.com>
Validator/Constraints/Unique.php
Outdated
* @param bool|array|string $ignoreNull The combination of fields that ignore null values | ||
*/ | ||
public function __construct( | ||
$fields, | ||
string $message = null, | ||
string $service = 'doctrine_odm.mongodb.unique', | ||
string $em = null, | ||
string $entityClass = null, | ||
string $repositoryMethod = null, | ||
string $errorPath = null, | ||
bool|string|array $ignoreNull = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param bool|array|string $ignoreNull The combination of fields that ignore null values | |
*/ | |
public function __construct( | |
$fields, | |
string $message = null, | |
string $service = 'doctrine_odm.mongodb.unique', | |
string $em = null, | |
string $entityClass = null, | |
string $repositoryMethod = null, | |
string $errorPath = null, | |
bool|string|array $ignoreNull = null, | |
*/ | |
public function __construct( | |
$fields, | |
string $message = null, | |
string $service = 'doctrine_odm.mongodb.unique', | |
string $em = null, | |
string $entityClass = null, | |
string $repositoryMethod = null, | |
string $errorPath = null, | |
bool $ignoreNull = null, |
Now I see this, union types are introduced in PHP >= 8.0, so I guess we should stick to Symfony 5.4 constructor: https://github.com/symfony/symfony/blob/8492f10d29e929a83ccf6c306d40dbad69c9c80b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php#L55
Adding a "simple" test would be awesome, we would have realized of this. (Test added)
9a6a41f
to
3320f06
Compare
Hello, Any ETA for a new release with this fix? Thanks! |
Fix #741.