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

[Validator] Update Type constraint, add number, finite-float and finite-number validations #18527

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

guillaume-a
Copy link
Contributor

@guillaume-a guillaume-a commented Jul 6, 2023

@guillaume-a
Copy link
Contributor Author

This PR should fix CI / Build : #18529

@OskarStark OskarStark added the Waiting Code Merge Docs for features pending to be merged label Jul 6, 2023
@carsonbot carsonbot modified the milestones: 6.4, next Jul 6, 2023
@OskarStark
Copy link
Contributor

IsFinite != Finite

@guillaume-a guillaume-a changed the title [Validator] Add Finite constraint [Validator] Add IsFinite constraint Jul 13, 2023
@guillaume-a
Copy link
Contributor Author

@OskarStark you're right, I renamed the Validator IsFinite

IsFinite
========

Validates that a value is a legal finite number.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Validates that a value is a legal finite number.
Validates that a value is a valid finite number.

fabpot added a commit to symfony/symfony that referenced this pull request Jul 30, 2023
…inite-float` and `finite-number` validations (guillaume-a)

This PR was merged into the 6.4 branch.

Discussion
----------

[Validator] Update `Type` constraint, add `number`, `finite-float` and `finite-number` validations

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #50782
| License       | MIT
| Doc PR        | symfony/symfony-docs#18527

Contraint `Type(['float'])` can produce positives with INF or NAN.
This new types car narrow validation and limit validation to finite numbers.

```
#[Assert\Type(['int', 'finite-float'])]
private $value;
```

Thank you for helping me with this one.

Commits
-------

c3b5709 [Validator] Update `Type` constraint, add `number`, `finite-float` and `finite-number` validations
symfony-splitter pushed a commit to symfony/validator that referenced this pull request Jul 30, 2023
…inite-float` and `finite-number` validations (guillaume-a)

This PR was merged into the 6.4 branch.

Discussion
----------

[Validator] Update `Type` constraint, add `number`, `finite-float` and `finite-number` validations

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #50782
| License       | MIT
| Doc PR        | symfony/symfony-docs#18527

Contraint `Type(['float'])` can produce positives with INF or NAN.
This new types car narrow validation and limit validation to finite numbers.

```
#[Assert\Type(['int', 'finite-float'])]
private $value;
```

Thank you for helping me with this one.

Commits
-------

c3b5709560 [Validator] Update `Type` constraint, add `number`, `finite-float` and `finite-number` validations
@guillaume-a guillaume-a changed the title [Validator] Add IsFinite constraint [Validator] Update Type constraint, add number, finite-float and finite-number validations Jul 31, 2023
@guillaume-a
Copy link
Contributor Author

guillaume-a commented Jul 31, 2023

I've re write the doc according to all changes done in the initial ticket.
No more IsFinite constraint, just some new entries in Type constraint.

@OskarStark OskarStark removed the Waiting Code Merge Docs for features pending to be merged label Jul 31, 2023
Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After my comment

@OskarStark
Copy link
Contributor

Thank you Guillaume.

@OskarStark OskarStark merged commit 03d356b into symfony:6.4 Jul 31, 2023
2 of 3 checks passed
@guillaume-a guillaume-a deleted the 50782 branch July 31, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants