Skip to content

[Validator] Allow to use property paths to get limits in range constraint #31511

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

Merged
merged 1 commit into from
Jul 8, 2019
Merged

[Validator] Allow to use property paths to get limits in range constraint #31511

merged 1 commit into from
Jul 8, 2019

Conversation

Lctrs
Copy link
Contributor

@Lctrs Lctrs commented May 16, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets Part of #31503
License MIT
Doc PR symfony/symfony-docs#11793

Similar as #22576, but for the Range constraint.

@Lctrs Lctrs changed the title [Validator] Allow to use a property path to get limits in range constraint [Validator] Allow to use property paths to get limits in range constraint May 16, 2019
@nicolas-grekas nicolas-grekas added this to the next milestone May 20, 2019
Copy link
Contributor

@ogizanagi ogizanagi left a comment

Choose a reason for hiding this comment

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

Same as suggested in #31526: when provided, adding the paths as parameters in the violation can be useful.

@Lctrs
Copy link
Contributor Author

Lctrs commented May 23, 2019

@ogizanagi Done.

@Lctrs Lctrs changed the base branch from master to 4.4 May 29, 2019 12:07
@Lctrs
Copy link
Contributor Author

Lctrs commented May 29, 2019

Rebased on 4.4.

@Lctrs
Copy link
Contributor Author

Lctrs commented Jun 11, 2019

Failure in Mailer component. Not related.

}

if ((isset($options['minPropertyPath']) || isset($options['maxPropertyPath'])) && !class_exists(PropertyAccess::class)) {
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option.', \get_class($this)));
Copy link
Contributor

Choose a reason for hiding this comment

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

should be Symfony\Component\Validator\Exception\LogicException

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fabpot
Copy link
Member

fabpot commented Jul 8, 2019

Thank you @Lctrs.

@fabpot fabpot merged commit 2b50990 into symfony:4.4 Jul 8, 2019
fabpot added a commit that referenced this pull request Jul 8, 2019
…in range constraint (Lctrs)

This PR was squashed before being merged into the 4.4 branch (closes #31511).

Discussion
----------

[Validator] Allow to use property paths to get limits in range constraint

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Part of #31503
| License       | MIT
| Doc PR        | symfony/symfony-docs#11793

Similar as #22576, but for the `Range` constraint.

Commits
-------

2b50990 [Validator] Allow to use property paths to get limits in range constraint
@Lctrs Lctrs deleted the feature/validator/range-property-paths branch July 8, 2019 13:06
fabpot added a commit that referenced this pull request Jul 9, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Fix Changelog for #31511

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

Commits
-------

9d72505 [Validator] Fix Changelog for #31511
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Jul 10, 2019
…traint (Lctrs)

This PR was squashed before being merged into the 4.4 branch (closes #11793).

Discussion
----------

Document the new property path options of the Range constraint

Related PR : symfony/symfony#31511

Commits
-------

08e724c Document the new property path options of the Range constraint
nicolas-grekas added a commit that referenced this pull request Jul 11, 2019
* 4.4: (53 commits)
  Fix Twig 1.x compatibility
  Deprecating templateExists method
  [Translator] Improve farsi(persian) translations for Form
  [Validator] Fix Changelog for #31511
  [Lock][Console] bump lock requirement in console
  [Lock] minor: add missing alias for PersistenStoreInterface
  Improve fa translations
  Dynamic bundle assets
  [Lock] rename and deprecate Factory into LockFactory
  [Debug] Restoring back the state of the Debug component (1st step)
  Spell "triggering" properly
  [Lock] Fix tests
  Added tests to cover the possibility of having scalars as services.
  fixed CS
  [Lock] Split \"StoreInterface\" into multiple interfaces with less responsability
  [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit
  [Validator] Allow to use property paths to get limits in range constraint
  Fix missing deprecations
  fixed tests on old PHP versions
  [FrameworkBundle] Inform the user when save_path will be ignored
  ...
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
hultberg pushed a commit to hultberg/symfony that referenced this pull request Sep 17, 2021
* 4.4: (53 commits)
  Fix Twig 1.x compatibility
  Deprecating templateExists method
  [Translator] Improve farsi(persian) translations for Form
  [Validator] Fix Changelog for symfony#31511
  [Lock][Console] bump lock requirement in console
  [Lock] minor: add missing alias for PersistenStoreInterface
  Improve fa translations
  Dynamic bundle assets
  [Lock] rename and deprecate Factory into LockFactory
  [Debug] Restoring back the state of the Debug component (1st step)
  Spell "triggering" properly
  [Lock] Fix tests
  Added tests to cover the possibility of having scalars as services.
  fixed CS
  [Lock] Split \"StoreInterface\" into multiple interfaces with less responsability
  [VarDumper] Let browsers trigger their own search on double CMD/CTRL + F hit
  [Validator] Allow to use property paths to get limits in range constraint
  Fix missing deprecations
  fixed tests on old PHP versions
  [FrameworkBundle] Inform the user when save_path will be ignored
  ...
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.

7 participants