Skip to content

Commit 47db19d

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: Update custom_constraint.rst Add form_theme in error customization Wrap the instantiation in parenthesis, and chain away fix variable being overwritten
2 parents bb8faba + f45161c commit 47db19d

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

email.rst

+2-1
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

+2-1
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

+1-1
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

+4
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 %}

performance.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,15 @@ If you're using the Standard Distribution, make the following changes::
138138
139139
use Symfony\Component\ClassLoader\ApcClassLoader;
140140

141-
$loader = require __DIR__.'/../app/autoload.php';
141+
// do not use $loader as a variable name here as it would
142+
// be overwritten when loading the bootstrap.php.cache file
143+
$classLoader = require __DIR__.'/../app/autoload.php';
142144
include_once __DIR__.'/../app/bootstrap.php.cache';
143145

144146
// Use APC for autoloading to improve performance
145147
// Change 'sf2' by the prefix you want in order
146148
// to prevent key conflict with another application
147-
$loader = new ApcClassLoader('sf2', $loader);
149+
$loader = new ApcClassLoader('sf2', $classLoader);
148150
$loader->register(true);
149151

150152
// ...

validation/custom_constraint.rst

+1-1
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)