Skip to content

Commit 9ec163b

Browse files
committed
feature #60475 [Validator] Revert Slug constraint (wouterj)
This PR was merged into the 7.3 branch. Discussion ---------- [Validator] Revert Slug constraint | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Reverts #58542 | License | MIT After an internal discussion, I think it's best to revert the introduction of the `Slug` constraint: * There is no official standard for slugs, or what a slug means exactly. Within Symfony, it would be best to comply with what our `AsciiSlugger` is doing, but a [more common approach](https://en.wikipedia.org/wiki/Clean_URL#Slug) is to only allow lowercase characters. * The constraint adds little on top of the existing `Regex` constraint, especially when using it's `regex` option to customize the pattern for slugs. Considering this, I believe it is always better for applications to be clear on what they allow in a slug using the `Regex` constraint. Commits ------- 5789965 Revert Slug constraint
2 parents 422893b + 5789965 commit 9ec163b

File tree

5 files changed

+0
-254
lines changed

5 files changed

+0
-254
lines changed

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ CHANGELOG
88
* Deprecate defining custom constraints not supporting named arguments
99
* Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead
1010
* Add support for ratio checks for SVG files to the `Image` constraint
11-
* Add the `Slug` constraint
1211
* Add support for the `otherwise` option in the `When` constraint
1312
* Add support for multiple fields containing nested constraints in `Composite` constraints
1413
* Add the `stopOnFirstError` option to the `Unique` constraint to validate all elements

src/Symfony/Component/Validator/Constraints/Slug.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/Symfony/Component/Validator/Constraints/SlugValidator.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/Symfony/Component/Validator/Tests/Constraints/SlugTest.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/Symfony/Component/Validator/Tests/Constraints/SlugValidatorTest.php

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)