Commit 5a4885e
committed
feature #9140 [Validator][Email] - Strict validation and soft dependency (egulias)
This PR was squashed before being merged into the 2.5-dev branch (closes #9140).
Discussion
----------
[Validator][Email] - Strict validation and soft dependency
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #1581, #4930
| License | MIT
| Doc PR | symfony/symfony-docs#3469
TODO
---------
- [x] submit changes to the documentation
- [x] document the BC breaks
- [x] finish the code
- [x] gather feedback for my changes
In #1581 @bschussek suggested to pass the strict_email config to `Validator\EmailValidator::__construct($strict)`, I did not put it there yet since the constraint can receive that configuration each time the constraint is used despite the fact of the global configuration. This could lead to some logic in the constructor and I wanted first to integrate the strict validator.
BC Break
--------------
I'm not sure of this, but as a soft dependency is added and now some emails that where valid before no longer are I thought it is.
Commits
-------
3368630 #1581 - Strict in Email constraint and use of Egulias\EmailValidatorFile tree
Expand file treeCollapse file tree
10 files changed
+89
-7
lines changedOpen diff view settings
Filter options
- src/Symfony
- Bundle/FrameworkBundle
- DependencyInjection
- Resources/config
- Tests/DependencyInjection
- Component/Validator
- Constraints
- Tests/Constraints
Expand file treeCollapse file tree
10 files changed
+89
-7
lines changedOpen diff view settings
Collapse file
+28Lines changed: 28 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
44 | 44 | |
45 | 45 | |
46 | 46 | |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
73 | 73 | |
74 | 74 | |
75 | 75 | |
76 | | - |
| 76 | + |
| 77 | + |
77 | 78 | |
78 | 79 | |
79 | 80 | |
|
Collapse file
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
445 | 445 | |
446 | 446 | |
447 | 447 | |
| 448 | + |
448 | 449 | |
449 | 450 | |
450 | 451 | |
|
Collapse file
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
678 | 678 | |
679 | 679 | |
680 | 680 | |
| 681 | + |
| 682 | + |
| 683 | + |
681 | 684 | |
682 | 685 | |
683 | 686 | |
|
Collapse file
src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
18 | 18 | |
19 | 19 | |
20 | 20 | |
| 21 | + |
21 | 22 | |
22 | 23 | |
23 | 24 | |
| ||
69 | 70 | |
70 | 71 | |
71 | 72 | |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
72 | 78 | |
73 | 79 | |
Collapse file
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
127 | 127 | |
128 | 128 | |
129 | 129 | |
| 130 | + |
130 | 131 | |
131 | 132 | |
132 | 133 | |
|
Collapse file
src/Symfony/Component/Validator/Constraints/Email.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Email.php+9Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
25 | 25 | |
26 | 26 | |
27 | 27 | |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
28 | 37 | |
Collapse file
src/Symfony/Component/Validator/Constraints/EmailValidator.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/EmailValidator.php+26-2Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
| 17 | + |
17 | 18 | |
18 | 19 | |
19 | 20 | |
| ||
22 | 23 | |
23 | 24 | |
24 | 25 | |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
25 | 38 | |
26 | 39 | |
27 | 40 | |
| ||
40 | 53 | |
41 | 54 | |
42 | 55 | |
43 | | - |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
44 | 68 | |
45 | 69 | |
46 | 70 | |
47 | | - |
48 | 71 | |
| 72 | + |
49 | 73 | |
50 | 74 | |
51 | 75 | |
|
Collapse file
src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php+9-2Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
22 | 22 | |
23 | 23 | |
24 | 24 | |
25 | | - |
| 25 | + |
26 | 26 | |
27 | 27 | |
28 | 28 | |
| ||
100 | 100 | |
101 | 101 | |
102 | 102 | |
103 | | - |
104 | 103 | |
105 | 104 | |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
106 | 113 | |
Collapse file
src/Symfony/Component/Validator/composer.json
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/composer.json+4-2Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | | - |
| 29 | + |
| 30 | + |
30 | 31 | |
31 | 32 | |
32 | 33 | |
33 | 34 | |
34 | 35 | |
35 | 36 | |
36 | 37 | |
37 | | - |
| 38 | + |
| 39 | + |
38 | 40 | |
39 | 41 | |
40 | 42 | |
|
0 commit comments