Skip to content

Commit 5ea29a5

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: 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 Fix UrlMatcher::match() URL
2 parents e808790 + 5242e92 commit 5ea29a5

35 files changed

+57
-52
lines changed

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
@@ -126,7 +126,7 @@ some developers configure form buttons in the controller::
126126
$form = $this->createForm(PostType::class, $post);
127127
$form->add('submit', SubmitType::class, array(
128128
'label' => 'Create',
129-
'attr' => array('class' => 'btn btn-default pull-right')
129+
'attr' => array('class' => 'btn btn-default pull-right'),
130130
));
131131

132132
// ...

components/dom_crawler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ Pass an array of values::
384384
// sets multiple fields at once
385385
$form->setValues(array('multi' => array(
386386
1 => 'value',
387-
'dimensional' => 'an other value'
387+
'dimensional' => 'an other value',
388388
)));
389389

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

components/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ class, which can make this even easier::
557557

558558
$response = new JsonResponse();
559559
$response->setData(array(
560-
'data' => 123
560+
'data' => 123,
561561
));
562562

563563
This encodes your array of data to JSON and sets the ``Content-Type`` header

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
@@ -512,9 +512,10 @@ There are several types of normalizers available:
512512
directly and through getters, setters, hassers, adders and removers. It supports
513513
calling the constructor during the denormalization process.
514514

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

519520
The ``ObjectNormalizer`` is the most powerful normalizer. It is configured by
520521
default when using the Symfony Standard Edition with the serializer enabled.
@@ -524,8 +525,9 @@ There are several types of normalizers available:
524525
(public methods starting with "get"). It will denormalize data by calling
525526
the constructor and the "setters" (public methods starting with "set").
526527

527-
Objects are normalized to a map of property names (method name stripped of
528-
the "get" prefix and converted to lower case) to property values.
528+
Objects are normalized to a map of property names and values (names are
529+
generated removing the ``get`` prefix from the method name and lowercasing
530+
the first letter; e.g. ``getFirstName()`` -> ``firstName``).
529531

530532
:class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`
531533
This normalizer directly reads and writes public properties as well as
@@ -596,7 +598,8 @@ Circular references are common when dealing with entity relations::
596598
}
597599

598600
To avoid infinite loops, :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`
599-
throws a :class:`Symfony\\Component\\Serializer\\Exception\\CircularReferenceException`
601+
or :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer`
602+
throw a :class:`Symfony\\Component\\Serializer\\Exception\\CircularReferenceException`
600603
when such a case is encountered::
601604

602605
$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

console/style.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ of your commands to change their appearance::
372372

373373
// After
374374
$io = new CustomStyle($input, $output);
375-
376375
// ...
377376
}
378377
}

doctrine/event_listeners_subscribers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ managers that use this connection.
106106
->register('my.listener2', SearchIndexer2::class)
107107
->addTag('doctrine.event_listener', array(
108108
'event' => 'postPersist',
109-
'connection' => 'default'
109+
'connection' => 'default',
110110
))
111111
;
112112
$container

0 commit comments

Comments
 (0)