Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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