Skip to content

Commit 80a90ba

Browse files
committed
minor symfony#3500 Minimize horizontal scrolling in code blocks (improve readability) (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)
2 parents e5bc4ea + bfd1584 commit 80a90ba

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

cookbook/templating/PHP.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ below renders the ``index.html.php`` template::
5454
// ...
5555
public function indexAction($name)
5656
{
57-
return $this->render('AcmeHelloBundle:Hello:index.html.php', array('name' => $name));
57+
return $this->render(
58+
'AcmeHelloBundle:Hello:index.html.php',
59+
array('name' => $name)
60+
);
5861
}
5962

6063
You can also use the :doc:`/bundles/SensioFrameworkExtraBundle/annotations/view`

cookbook/validation/custom_constraint.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ The validator class is also simple, and only has one required method ``validate(
6565
public function validate($value, Constraint $constraint)
6666
{
6767
if (!preg_match('/^[a-zA-Za0-9]+$/', $value, $matches)) {
68-
$this->context->addViolation($constraint->message, array('%string%' => $value));
68+
$this->context->addViolation(
69+
$constraint->message,
70+
array('%string%' => $value)
71+
);
6972
}
7073
}
7174
}
@@ -216,7 +219,12 @@ With this, the validator ``validate()`` method gets an object as its first argum
216219
public function validate($protocol, Constraint $constraint)
217220
{
218221
if ($protocol->getFoo() != $protocol->getBar()) {
219-
$this->context->addViolationAt('foo', $constraint->message, array(), null);
222+
$this->context->addViolationAt(
223+
'foo',
224+
$constraint->message,
225+
array(),
226+
null
227+
);
220228
}
221229
}
222230
}

0 commit comments

Comments
 (0)