Skip to content

Commit 62b3c9f

Browse files
committed
Merge branch '4.1'
* 4.1: Fixed some wrong file paths Change code file location Fix typo for variable name Add link to configuration documentation Update upgrade_major.rst Add composer require symfony/webpack-encore-pack Reword the intro of a console article fix(Caution): Validator folder for YAML or XML format Fix the interface/abstract classes documentation Fix typo in Memcached adapter documentation [#9507] add versionadded directive Revert "[#9507] remove csv processor, it was added in 4.1" [#9507] remove csv processor, it was added in 4.1
2 parents 5f88a89 + 62339e9 commit 62b3c9f

File tree

10 files changed

+28
-19
lines changed

10 files changed

+28
-19
lines changed

components/cache/adapters/memcached_adapter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Available Options
263263
small outgoing messages and sending them all at once.
264264

265265
``use_udp`` (type: ``bool``, default: ``false``)
266-
Enables or disabled the use of `User Datagram Protocol (UDP)`_ mode (instead
266+
Enables or disables the use of `User Datagram Protocol (UDP)`_ mode (instead
267267
of `Transmission Control Protocol (TCP)`_ mode), where all operations are
268268
executed in a "fire-and-forget" manner; no attempt to ensure the operation
269269
has been received or acted on will be made once the client has executed it.

components/console/console_arguments.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
.. index::
22
single: Console; Console arguments
33

4-
Understanding how Console Arguments Are Handled
5-
===============================================
4+
Understanding how Console Arguments and Options Are Handled
5+
===========================================================
66

7-
It can be difficult to understand the way arguments are handled by the console application.
8-
The Symfony Console application, like many other CLI utility tools, follows the behavior
9-
described in the `docopt`_ standards.
7+
Symfony Console applications follow the same `docopt`_ standard used in most
8+
CLI utility tools. This article explains how to handle edge-cases when the
9+
commands define options with required values, without values, etc. Read
10+
:doc:`this other article </console/input>` to learn about using arguments and
11+
options inside Symfony Console commands.
1012

1113
Have a look at the following command that has three options::
1214

components/serializer.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,8 +1168,8 @@ serialize and deserialize these objects using a *"discriminator class mapping"*.
11681168

11691169
The discriminator is the field (in the serialized string) used to differentiate
11701170
between the possible objects. In practice, when using the Serializer component,
1171-
pass the :class:`Symfony\\Component\\Serializer\\Mapping\\ClassDiscriminatorResolver`
1172-
to the :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer`.
1171+
pass a :class:`Symfony\\Component\\Serializer\\Mapping\\ClassDiscriminatorResolverInterface`
1172+
implementation to the :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer`.
11731173

11741174
Consider an application that defines an abstract ``CodeRepository`` class
11751175
extended by ``GitHubCodeRepository`` and ``BitBucketCodeRepository`` classes.
@@ -1178,18 +1178,20 @@ This example shows how to serialize and deserialize those objects::
11781178
// ...
11791179
use Symfony\Component\Serializer\Encoder\JsonEncoder;
11801180
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorMapping;
1181-
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorResolver;
1181+
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata;
11821182
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
11831183
use Symfony\Component\Serializer\Serializer;
11841184

1185-
$discriminator = new ClassDiscriminatorResolver();
1185+
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
1186+
1187+
$discriminator = new ClassDiscriminatorFromClassMetadata($classMetadataFactory);
11861188
$discriminator->addClassMapping(CodeRepository::class, new ClassDiscriminatorMapping('type', [
11871189
'github' => GitHubCodeRepository::class,
11881190
'bitbucket' => BitBucketCodeRepository::class,
11891191
]));
11901192

11911193
$serializer = new Serializer(
1192-
array(new ObjectNormalizer(null, null, null, null, $discriminator)),
1194+
array(new ObjectNormalizer($classMetadataFactory, null, null, null, $discriminator)),
11931195
array('json' => new JsonEncoder())
11941196
);
11951197

configuration/external_parameters.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ Symfony provides the following env var processors:
257257
framework:
258258
trusted_hosts: '%env(csv:TRUSTED_HOSTS)%'
259259
260+
.. versionadded:: 4.1
261+
The ``csv`` processor was introduced in Symfony 4.1.
262+
260263
``env(file:FOO)``
261264
Returns the contents of a file whose path is the value of the ``FOO`` env var:
262265

console/input.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ To solve this issue, you have to set the option's default value to ``false``::
257257

258258
Now check the value of the option and keep in mind that ``false !== null``::
259259

260-
$optionValue = $input->getOptions('yell');
260+
$optionValue = $input->getOption('yell');
261261
$yell = ($optionValue !== false);
262262
$yellLouder = ($optionValue === 'louder');
263263

frontend/encore/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Then, install Encore into your project with Yarn:
2323

2424
.. code-block:: terminal
2525
26-
$ composer require encore
26+
$ composer require symfony/webpack-encore-pack
2727
$ yarn install
2828
2929
This will create a ``webpack.config.js`` file, add the ``assets/`` directory, and add ``node_modules/`` to

page_creation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ Ok, time to finish mastering the fundamentals by reading these articles:
329329
* :doc:`/routing`
330330
* :doc:`/controller`
331331
* :doc:`/templating`
332+
* :doc:`/configuration`
332333

333334
Then, learn about other important topics like the
334335
:doc:`service container </service_container>`,

reference/forms/types/options/choice_label.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ more control::
1717
'maybe' => null,
1818
),
1919
'choice_label' => function ($choiceValue, $key, $value) {
20-
if ($value == choiceValue) {
20+
if ($value == $choiceValue) {
2121
return 'Definitely!';
2222
}
2323

setup/upgrade_major.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. index::
22
single: Upgrading; Major Version
33

4-
Upgrading a Major Version (e.g. 3.4.0 to 4.0.0)
4+
Upgrading a Major Version (e.g. 3.4.0 to 4.1.0)
55
===============================================
66

77
Every two years, Symfony releases a new major version release (the first number
@@ -30,7 +30,7 @@ backwards incompatible changes. To accomplish this, the "old" (e.g. functions,
3030
classes, etc) code still works, but is marked as *deprecated*, indicating that
3131
it will be removed/changed in the future and that you should stop using it.
3232

33-
When the major version is released (e.g. 4.0.0), all deprecated features and
33+
When the major version is released (e.g. 4.1.0), all deprecated features and
3434
functionality are removed. So, as long as you've updated your code to stop
3535
using these deprecated features in the last version before the major (e.g.
3636
3.4.*), you should be able to upgrade without a problem.
@@ -128,7 +128,7 @@ Composer by modifying your ``composer.json`` file:
128128
"...": "...",
129129
130130
"require": {
131-
"symfony/symfony": "^4.0",
131+
"symfony/symfony": "^4.1",
132132
},
133133
"...": "..."
134134
}

validation.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ So far, this is just an ordinary class that serves some purpose inside your
4343
application. The goal of validation is to tell you if the data
4444
of an object is valid. For this to work, you'll configure a list of rules
4545
(called :ref:`constraints <validation-constraints>`) that the object must
46-
follow in order to be valid. These rules can be specified via a number of
47-
different formats (YAML, XML, annotations, or PHP).
46+
follow in order to be valid. These rules are usually defined using PHP code or
47+
annotations but they can also be defined as a ``validation.yaml`` or
48+
``validation.xml`` file inside the ``config/validator/`` directory:
4849

4950
For example, to guarantee that the ``$name`` property is not empty, add the
5051
following:

0 commit comments

Comments
 (0)