Skip to content

Commit 94fc520

Browse files
committed
Minor tweaks and a missing location thanks to xabbuh and WouterJ
1 parent f97ba7a commit 94fc520

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cookbook/bundles/best_practices.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,15 @@ there are 3 modes, which the user can configure in their project:
341341

342342
As a bundle author, you'll want to support *both* API's, since some users
343343
may still be using the 2.4 API. Specifically, if your bundle adds a violation
344-
directly to the :class:`Symfony\Component\Validator\Context\ExecutionContext`
344+
directly to the :class:`Symfony\\Component\\Validator\\Context\\ExecutionContext`
345345
(e.g. like in a custom validation constraint), you'll need to check for which
346346
API is being used. The following code, would work for *all* users::
347347

348+
use Symfony\Component\Validator\ConstraintValidator;
349+
use Symfony\Component\Validator\Constraint;
350+
use Symfony\Component\Validator\Context\ExecutionContextInterface;
351+
// ...
352+
348353
class ContainsAlphanumericValidator extends ConstraintValidator
349354
{
350355
public function validate($value, Constraint $constraint)

cookbook/form/unit_testing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ on other extensions. You need add those extensions to the factory object::
185185
{
186186
parent::setUp();
187187
188-
$validator = $this->getMock('\Symfony\Component\Validator\ValidatorInterface');
188+
$validator = $this->getMock('\Symfony\Component\Validator\Validator\ValidatorInterface');
189189
$validator->method('validate')->will($this->returnValue(new ConstraintViolationList()));
190190

191191
$this->factory = Forms::createFormFactoryBuilder()

0 commit comments

Comments
 (0)