Skip to content

Commit

Permalink
minor #3500 Minimize horizontal scrolling in code blocks (improve rea…
Browse files Browse the repository at this point in the history
…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 80a90ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cookbook/templating/PHP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
12 changes: 10 additions & 2 deletions cookbook/validation/custom_constraint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}
}
}
Expand Down Expand Up @@ -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
);
}
}
}
Expand Down

0 comments on commit 80a90ba

Please sign in to comment.