Skip to content

Commit 0c53298

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: Fix missing trailling commas [Serializer] Added missing ObjectNormalizer [Serializer] By default the serializer do not convert to lower case properties Added a note about named form types Update translation.rst Fixed the path of an image Fix UrlMatcher::match() URL Updated a diagram to SVG format
2 parents 903189f + 5ea29a5 commit 0c53298

35 files changed

+78
-69
lines changed
-62.8 KB
Binary file not shown.

_images/security/authentication-guard-methods.svg

Lines changed: 1 addition & 0 deletions
Loading
Binary file not shown.

best_practices/controllers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ for the homepage of our app:
111111
->findLatest();
112112
113113
return $this->render('default/index.html.twig', array(
114-
'posts' => $posts
114+
'posts' => $posts,
115115
));
116116
}
117117
}

best_practices/forms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ some developers configure form buttons in the controller::
127127
$form = $this->createForm(PostType::class, $post);
128128
$form->add('submit', SubmitType::class, array(
129129
'label' => 'Create',
130-
'attr' => array('class' => 'btn btn-default pull-right')
130+
'attr' => array('class' => 'btn btn-default pull-right'),
131131
));
132132

133133
// ...

components/dom_crawler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ Pass an array of values::
470470
// sets multiple fields at once
471471
$form->setValues(array('multi' => array(
472472
1 => 'value',
473-
'dimensional' => 'an other value'
473+
'dimensional' => 'an other value',
474474
)));
475475

476476
This is great, but it gets better! The ``Form`` object allows you to interact

components/routing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ URL path and some array of custom variables in its constructor. This array
6262
of custom variables can be *anything* that's significant to your application,
6363
and is returned when that route is matched.
6464

65-
The :method:`UrlMatcher::match() <Symfony\\Component\\Routing\\UrlMatcher::match>`
65+
The :method:`UrlMatcher::match() <Symfony\\Component\\Routing\\Matcher\\UrlMatcher::match>`
6666
returns the variables you set on the route as well as the wildcard placeholders
6767
(see below). Your application can now use this information to continue
6868
processing the request. In addition to the configured variables, a ``_route``

components/serializer.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,10 @@ There are several types of normalizers available:
554554
directly and through getters, setters, hassers, adders and removers. It supports
555555
calling the constructor during the denormalization process.
556556

557-
Objects are normalized to a map of property names (method name stripped of
558-
the "get"/"set"/"has"/"remove" prefix and converted to lower case) to property
559-
values.
557+
Objects are normalized to a map of property names and values (names are
558+
generated removing the ``get``, ``set``, ``has`` or ``remove`` prefix from
559+
the method name and lowercasing the first letter; e.g. ``getFirstName()`` ->
560+
``firstName``).
560561

561562
The ``ObjectNormalizer`` is the most powerful normalizer. It is configured by
562563
default when using the Symfony Standard Edition with the serializer enabled.
@@ -566,8 +567,9 @@ There are several types of normalizers available:
566567
(public methods starting with "get"). It will denormalize data by calling
567568
the constructor and the "setters" (public methods starting with "set").
568569

569-
Objects are normalized to a map of property names (method name stripped of
570-
the "get" prefix and converted to lower case) to property values.
570+
Objects are normalized to a map of property names and values (names are
571+
generated removing the ``get`` prefix from the method name and lowercasing
572+
the first letter; e.g. ``getFirstName()`` -> ``firstName``).
571573

572574
:class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`
573575
This normalizer directly reads and writes public properties as well as
@@ -699,7 +701,8 @@ Circular references are common when dealing with entity relations::
699701
}
700702

701703
To avoid infinite loops, :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`
702-
throws a :class:`Symfony\\Component\\Serializer\\Exception\\CircularReferenceException`
704+
or :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer`
705+
throw a :class:`Symfony\\Component\\Serializer\\Exception\\CircularReferenceException`
703706
when such a case is encountered::
704707

705708
$member = new Member();

components/translation.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ The constructor of the ``Translator`` class needs one argument: The locale.
3434
.. code-block:: php
3535
3636
use Symfony\Component\Translation\Translator;
37-
use Symfony\Component\Translation\MessageSelector;
3837
39-
$translator = new Translator('fr_FR', new MessageSelector());
38+
$translator = new Translator('fr_FR');
4039
4140
.. note::
4241

configuration/environments.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ configuration file:
139139
140140
$container->loadFromExtension('web_profiler', array(
141141
'toolbar' => true,
142-
143142
// ...
144143
));
145144

0 commit comments

Comments
 (0)