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 | https://github.com/silexphp/Silex/issues/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
This commit is contained in:
commit
95f8e43205
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
<service id="validator.email" class="%validator.email.class%">
|
<service id="validator.email" class="%validator.email.class%">
|
||||||
<argument></argument>
|
<argument></argument>
|
||||||
<tag name="validator.constraint_validator" alias="validator.email" />
|
<tag name="validator.constraint_validator" alias="Symfony\Component\Validator\Constraints\EmailValidator" />
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
</container>
|
</container>
|
||||||
|
|
|
@ -26,12 +26,4 @@ class Email extends Constraint
|
||||||
public $checkMX = false;
|
public $checkMX = false;
|
||||||
public $checkHost = false;
|
public $checkHost = false;
|
||||||
public $strict = null;
|
public $strict = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
public function validatedBy()
|
|
||||||
{
|
|
||||||
return 'validator.email';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue