Skip to content

Commit f45161c

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Update custom_constraint.rst Add form_theme in error customization Wrap the instantiation in parenthesis, and chain away
2 parents 1d22d54 + 48db377 commit f45161c

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

email.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ an email is pretty straightforward::
103103

104104
public function indexAction($name)
105105
{
106-
$message = new \Swift_Message('Hello Email')
106+
$message = (new \Swift_Message('Hello Email'))
107107
->setFrom('send@example.com')
108108
->setTo('recipient@example.com')
109109
->setBody(
@@ -125,6 +125,7 @@ an email is pretty straightforward::
125125
)
126126
*/
127127
;
128+
128129
$this->get('mailer')->send($message);
129130

130131
return $this->render(...);

email/dev_environment.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Now, suppose you're sending an email to ``recipient@example.com``.
100100
101101
public function indexAction($name)
102102
{
103-
$message = new \Swift_Message('Hello Email')
103+
$message = (new \Swift_Message('Hello Email'))
104104
->setFrom('send@example.com')
105105
->setTo('recipient@example.com')
106106
->setBody(
@@ -110,6 +110,7 @@ Now, suppose you're sending an email to ``recipient@example.com``.
110110
)
111111
)
112112
;
113+
113114
$this->get('mailer')->send($message);
114115
115116
return $this->render(...);

email/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Start with an easy controller action that sends an email::
1414

1515
public function sendEmailAction($name)
1616
{
17-
$message = new \Swift_Message('Hello Email')
17+
$message = (new \Swift_Message('Hello Email'))
1818
->setFrom('send@example.com')
1919
->setTo('recipient@example.com')
2020
->setBody('You should see me from the profiler!')

form/form_customization.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,8 @@ and customize the ``form_errors`` fragment.
873873

874874
.. code-block:: html+twig
875875

876+
{% form_theme form _self %}
877+
876878
{# form_errors.html.twig #}
877879
{% block form_errors %}
878880
{% spaceless %}
@@ -933,6 +935,8 @@ fields (e.g. a whole form), and not just an individual field.
933935

934936
.. code-block:: html+twig
935937

938+
{% form_theme form _self %}
939+
936940
{# form_errors.html.twig #}
937941
{% block form_errors %}
938942
{% spaceless %}

validation/custom_constraint.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ includes some simple default logic::
4545
// in the base Symfony\Component\Validator\Constraint class
4646
public function validatedBy()
4747
{
48-
return get_class($this).'Validator';
48+
return ContainsAlphanumericValidator::class;
4949
}
5050

5151
In other words, if you create a custom ``Constraint`` (e.g. ``MyConstraint``),

0 commit comments

Comments
 (0)