-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Add property types and return types in constraints #18362
Add property types and return types in constraints #18362
Conversation
doctrine/resolve_target_entity.rst
Outdated
@@ -69,7 +69,7 @@ An Invoice entity:: | |||
* @var InvoiceSubjectInterface |
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.
Can be removed then
@@ -112,7 +114,7 @@ that a date must at least be the next day: | |||
class Order | |||
{ | |||
#[Assert\GreaterThan('today')] | |||
protected $deliveryDate; | |||
protected \DateTime $deliveryDate; |
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.
protected \DateTime $deliveryDate; | |
protected \DateTimeInterface $deliveryDate; |
?
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.
Updated!
@@ -169,7 +173,7 @@ dates. If you want to fix the timezone, append it to the date string: | |||
class Order | |||
{ | |||
#[Assert\GreaterThan('today UTC')] | |||
protected $deliveryDate; | |||
protected \DateTime $deliveryDate; |
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.
same for the others?
b6c7f68
to
056a3bc
Compare
056a3bc
to
2339f19
Compare
2339f19
to
e33a140
Compare
Alex, thanks a million for the colossal effort of adding so many types 🙇🙇🙇 |
…pe´ constraint is used (xabbuh) This PR was merged into the 6.4 branch. Discussion ---------- [Validator] drop type-hints for properties where the ´Type´ constraint is used partially revert #18362 as having the native type-hints prevents the `Type` constraint to be applied in a meaningful way (if the types don't match, PHP will error before) Commits ------- 27a06be drop type-hints for properties where the Type constraint is used
Forgot a "few" ones in constraints 😄