Permalink
Browse files

minor #3500 Minimize horizontal scrolling in code blocks (improve rea…

…dability) (ifdattic)

This PR was merged into the 2.3 branch.

Discussion
----------

Minimize horizontal scrolling in code blocks (improve readability)

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

Commits
-------

bfd1584 Minimize horizontal scrolling in code blocks (improve readability)
  • Loading branch information...
weaverryan committed Feb 3, 2014
2 parents e5bc4ea + bfd1584 commit 80a90ba8b5c2eceeb2d80bb1386fb2620b8e0c6e
Showing with 14 additions and 3 deletions.
  1. +4 −1 cookbook/templating/PHP.rst
  2. +10 −2 cookbook/validation/custom_constraint.rst
@@ -54,7 +54,10 @@ below renders the ``index.html.php`` template::
// ...
public function indexAction($name)
{
return $this->render('AcmeHelloBundle:Hello:index.html.php', array('name' => $name));
return $this->render(
'AcmeHelloBundle:Hello:index.html.php',
array('name' => $name)
);
}
You can also use the :doc:`/bundles/SensioFrameworkExtraBundle/annotations/view`
@@ -65,7 +65,10 @@ The validator class is also simple, and only has one required method ``validate(
public function validate($value, Constraint $constraint)
{
if (!preg_match('/^[a-zA-Za0-9]+$/', $value, $matches)) {
$this->context->addViolation($constraint->message, array('%string%' => $value));
$this->context->addViolation(
$constraint->message,
array('%string%' => $value)
);
}
}
}
@@ -216,7 +219,12 @@ With this, the validator ``validate()`` method gets an object as its first argum
public function validate($protocol, Constraint $constraint)
{
if ($protocol->getFoo() != $protocol->getBar()) {
$this->context->addViolationAt('foo', $constraint->message, array(), null);
$this->context->addViolationAt(
'foo',
$constraint->message,
array(),
null
);
}
}
}

0 comments on commit 80a90ba

Please sign in to comment.