Skip to content

Removed old deprecated directives. #11775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,6 @@ When serializing, you can set a callback to format a specific object property::
$serializer->serialize($person, 'json');
// Output: {"name":"cordoval", "age": 34, "createdAt": "2014-03-22T09:43:12-0500"}

.. deprecated:: 4.2

The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setCallbacks` is deprecated since
Symfony 4.2, use the "callbacks" key of the context instead.

.. _component-serializer-normalizers:

Normalizers
Expand Down Expand Up @@ -951,12 +946,6 @@ having unique identifiers::
var_dump($serializer->serialize($org, 'json'));
// {"name":"Les-Tilleuls.coop","members":[{"name":"K\u00e9vin", organization: "Les-Tilleuls.coop"}]}

.. deprecated:: 4.2

The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setCircularReferenceHandler`
method is deprecated since Symfony 4.2. Use the ``circular_reference_handler``
key of the context instead.

Handling Serialization Depth
----------------------------

Expand Down Expand Up @@ -1108,12 +1097,6 @@ having unique identifiers::
];
*/

.. deprecated:: 4.2

The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setMaxDepthHandler`
method is deprecated since Symfony 4.2. Use the ``max_depth_handler``
key of the context instead.

Handling Arrays
---------------

Expand Down
5 changes: 0 additions & 5 deletions configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,6 @@ can override it for commands by setting the ``APP_ENV`` value before running the
# Ignore the .env file and run this command in production
$ APP_ENV=prod php bin/console command_name

.. deprecated:: 4.2

In previous Symfony versions you could configure the environment with the
``--env`` command option, which was deprecated in Symfony 4.2.

Creating a New Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
5 changes: 0 additions & 5 deletions configuration/front_controllers_and_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ before running them:
# Ignore the .env file and enable the debug mode for this command
$ APP_DEBUG=1 php bin/console command_name

.. deprecated:: 4.2

In previous Symfony versions you could configure the debug mode with the
``--no-debug`` command option, which was deprecated in Symfony 4.2.

Internally, the value of the debug mode becomes the ``kernel.debug``
parameter used inside the :doc:`service container </service_container>`.
If you look inside the application configuration file, you'll see the
Expand Down
52 changes: 0 additions & 52 deletions reference/twig_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -356,33 +356,6 @@ trans
Translates the text into the current language. More information in
:ref:`Translation Filters <translation-filters>`.

transchoice
~~~~~~~~~~~

.. deprecated:: 4.2

The ``transchoice`` filter is deprecated since Symfony 4.2 and will be
removed in 5.0. Use the :doc:`ICU MessageFormat </translation/message_format>` with
the ``trans`` filter instead.

.. code-block:: twig

{{ message|transchoice(count, arguments = [], domain = null, locale = null) }}

``message``
**type**: ``string``
``count``
**type**: ``integer``
``arguments`` *(optional)*
**type**: ``array`` **default**: ``[]``
``domain`` *(optional)*
**type**: ``string`` **default**: ``null``
``locale`` *(optional)*
**type**: ``string`` **default**: ``null``

Translates the text with pluralization support. More information in
:ref:`Translation Filters <translation-filters>`.

yaml_encode
~~~~~~~~~~~

Expand Down Expand Up @@ -591,31 +564,6 @@ trans

Renders the translation of the content. More information in :ref:`translation-tags`.

transchoice
~~~~~~~~~~~

.. deprecated:: 4.2

The ``transchoice`` tag is deprecated since Symfony 4.2 and will be
removed in 5.0. Use the :doc:`ICU MessageFormat </translation/message_format>` with
the ``trans`` tag instead.

.. code-block:: twig

{% transchoice count with vars from domain into locale %}{% endtranschoice %}

``count``
**type**: ``integer``
``vars`` *(optional)*
**type**: ``array`` **default**: ``[]``
``domain`` *(optional)*
**type**: ``string`` **default**: ``null``
``locale`` *(optional)*
**type**: ``string`` **default**: ``null``

Renders the translation of the content with pluralization support, more
information in :ref:`translation-tags`.

trans_default_domain
~~~~~~~~~~~~~~~~~~~~

Expand Down
40 changes: 3 additions & 37 deletions translation/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,13 @@ Twig Templates
Using Twig Tags
~~~~~~~~~~~~~~~

Symfony provides specialized Twig tags (``trans`` and ``transchoice``) to
help with message translation of *static blocks of text*:
Symfony provides a specialized Twig tag ``trans`` to help with message
translation of *static blocks of text*:

.. code-block:: twig

{% trans %}Hello %name%{% endtrans %}

{% transchoice count %}
{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples
{% endtranschoice %}

The ``transchoice`` tag automatically gets the ``%count%`` variable from
the current context and passes it to the translator. This mechanism only
works when you use a placeholder following the ``%var%`` pattern.

.. deprecated:: 4.2

The ``transchoice`` tag is deprecated since Symfony 4.2 and will be
removed in 5.0. Use the :doc:`ICU MessageFormat </translation/message_format>` with
the ``trans`` tag instead.

.. caution::

The ``%var%`` notation of placeholders is required when translating in
Expand All @@ -48,34 +34,19 @@ You can also specify the message domain and pass some additional variables:

{% trans with {'%name%': 'Fabien'} from 'app' into 'fr' %}Hello %name%{% endtrans %}

{% transchoice count with {'%name%': 'Fabien'} from 'app' %}
{0} %name%, there are no apples|{1} %name%, there is one apple|]1,Inf[ %name%, there are %count% apples
{% endtranschoice %}

.. _translation-filters:

Using Twig Filters
~~~~~~~~~~~~~~~~~~

The ``trans`` and ``transchoice`` filters can be used to translate *variable
texts* and complex expressions:
The ``trans`` filter can be used to translate *variable texts* and complex expressions:

.. code-block:: twig

{{ message|trans }}

{{ message|transchoice(5) }}

{{ message|trans({'%name%': 'Fabien'}, 'app') }}

{{ message|transchoice(5, {'%name%': 'Fabien'}, 'app') }}

.. deprecated:: 4.2

The ``transchoice`` filter is deprecated since Symfony 4.2 and will be
removed in 5.0. Use the :doc:`ICU MessageFormat </translation/message_format>` with
the ``trans`` filter instead.

.. tip::

Using the translation tags or filters have the same effect, but with
Expand Down Expand Up @@ -116,8 +87,3 @@ The translator service is accessible in PHP templates through the

<?= $view['translator']->trans('Symfony is great') ?>

<?= $view['translator']->transChoice(
'{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples',
10,
['%count%' => 10]
) ?>