8000 bug #10581 [Validator][Email] - When standalone "Fatal error: Class '… · symfony/symfony@95f8e43 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95f8e43

Browse files
committed
bug #10581 [Validator][Email] - When standalone "Fatal error: Class 'validator.email' not found" (egulias)
This PR was merged into the 2.5-dev branch. Discussion ---------- [Validator][Email] - When standalone "Fatal error: Class 'validator.email' not found" | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | silexphp/Silex#932 | License | MIT | Doc PR | no When using the validator as an standalone component a bug was introduced by overriding the `validatedBy()` method in the `Email` constraint. This PR removes the override and implements a way for the DI to get the right validator. Another way would be modifying the definition of validator to change the alias instead of having the FQCN in the xml Commits ------- e79b3a9 Change in validator.email service alias to match the validator FQCN
2 parents 3cd1c9c + e79b3a9 commit 95f8e43

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
<service id="validator.email" class="%validator.email.class%">
7575
<argument></argument>
76-
<tag name="validator.constraint_validator" alias="validator.email" />
76+
<tag name="validator.constraint_validator" alias="Symfony\Component\Validator\Constraints\EmailValidator" />
7777
</service>
7878
</services>
7979
</container>

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,4 @@ class Email extends Constraint
2626
public $checkMX = false;
2727
public $checkHost = false;
2828
public $strict = null;
29-
30-
/**
31-
* {@inheritDoc}
32-
*/
33-
public function validatedBy()
34-
{
35-
return 'validator.email';
36-
}
3729
}

0 commit comments

Comments
 (0)
0