Skip to content

Commit 89a7a2a

Browse files
patrick-mcdougleweaverryan
authored andcommitted
Added namespace and use to the ProtocolValidator Class to be more clear.
Updated NotBlankValidator to ProtocolValidator.
1 parent 0d77841 commit 89a7a2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cookbook/validation/custom_constraint.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ Symfony2 will automatically look for another class, ``MyConstraintValidator``
4848
when actually performing the validation.
4949

5050
The validator class is also simple, and only has one required method: ``isValid``.
51-
Take the ``NotBlankValidator`` as an example:
51+
Furthering our example, take a look at the ``ProtocolValidator`` as an example:
5252

5353
.. code-block:: php
5454
55+
namespace Symfony\Component\Validator\Constraints;
56+
57+
use Symfony\Component\Validator\Constraint;
58+
use Symfony\Component\Validator\ConstraintValidator;
59+
5560
class ProtocolValidator extends ConstraintValidator
5661
{
5762
public function isValid($value, Constraint $constraint)

0 commit comments

Comments
 (0)