Skip to content

Removed deprecated contents #11621

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

Closed
Closed
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
4 changes: 0 additions & 4 deletions bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@ The ``Configuration`` class to handle the sample configuration looks like::
}
}

.. deprecated:: 4.2

Not passing the root node name to ``TreeBuilder`` was deprecated in Symfony 4.2.

.. seealso::

The ``Configuration`` class can be much more complicated than shown here,
Expand Down
4 changes: 0 additions & 4 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ implements the :class:`Symfony\\Component\\Config\\Definition\\ConfigurationInte
}
}

.. deprecated:: 4.2

Not passing the root node name to ``TreeBuilder`` was deprecated in Symfony 4.2.

Adding Node Definitions to the Tree
-----------------------------------

Expand Down
24 changes: 1 addition & 23 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,6 @@ key in the ``context`` parameter of the desired serializer method::
$serializer = new Serializer([$normalizer], [$encoder]);
$serializer->serialize($person, 'json', ['ignored_attributes' => ['age']]); // Output: {"name":"foo"}

.. deprecated:: 4.2

The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setIgnoredAttributes`
method that was used as an alternative to the ``ignored_attributes`` option
was deprecated in Symfony 4.2.

.. _component-serializer-converting-property-names-when-serializing-and-deserializing:

Converting Property Names when Serializing and Deserializing
Expand Down Expand Up @@ -639,12 +633,6 @@ and ``remove``.
Using Callbacks to Serialize Properties with Object Instances
-------------------------------------------------------------

.. deprecated:: 4.2

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

When serializing, you can set a callback to format a specific object property::

use App\Model\Person;
Expand All @@ -664,7 +652,7 @@ When serializing, you can set a callback to format a specific object property::
'createdAt' => $callback,
],
];

$normalizer = new GetSetMethodNormalizer(null, null, null, null, null, $defaultContext);

$serializer = new Serializer([$normalizer], [$encoder]);
Expand Down Expand Up @@ -800,10 +788,6 @@ The ``CsvEncoder`` encodes to and decodes from CSV.
You can pass the context key ``as_collection`` in order to have the results
always as a collection.

.. deprecated:: 4.2

Relying on the default value ``false`` is deprecated since Symfony 4.2.

The ``XmlEncoder``
~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -951,12 +935,6 @@ The ``setCircularReferenceLimit()`` method of this normalizer sets the number
of times it will serialize the same object before considering it a circular
reference. Its default value is ``1``.

.. 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.

Instead of throwing an exception, circular references can also be handled
by custom callables. This is especially useful when serializing entities
having unique identifiers::
Expand Down
8 changes: 4 additions & 4 deletions configuration/environment_variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ whenever the corresponding environment variable is *not* found:
// config/services.php
$container->setParameter('env(DATABASE_HOST)', 'localhost');

.. deprecated:: 4.3
.. note::

Passing non-string values as default values for environment variables is
deprecated since Symfony 4.3. Use :ref:`environment variable processors <env-var-processors>`
if you need to transform those string default values into other data types.
The default values of environment variables must be strings, but you can use
:ref:`environment variable processors <env-var-processors>` to transform
them into other data types.

.. _configuration-env-var-in-prod:

Expand Down
10 changes: 3 additions & 7 deletions configuration/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,9 @@ Selecting the Environment for Console Commands
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, Symfony commands are executed in whatever environment is defined by
the ``APP_ENV`` environment variable (usually configured in your ``.env`` file).
In previous Symfony versions you could use the ``--env`` (and ``--no-debug``)
command line options to override this value. However, those options were
deprecated in Symfony 4.2.

Use the ``APP_ENV`` (and ``APP_DEBUG``) environment variables to change the
environment and the debug behavior of the commands:
the ``APP_ENV`` environment variable and with the debug mode set by ``APP_DEBUG``.
It's recommended to configure these env vars in your ``.env`` file, but you can
also override them for some specific commands as follows:

.. code-block:: terminal

Expand Down
7 changes: 0 additions & 7 deletions console/commands_as_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ works! You can call the ``app:sunshine`` command and start logging.
work (e.g. making database queries), as that code will be run, even if you're using
the console to execute a different command.

.. note::

In previous Symfony versions, you could make the command class extend from
:class:`Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand` to
get services via ``$this->getContainer()->get('SERVICE_ID')``. This is
deprecated in Symfony 4.2 and it won't work in future Symfony versions.

.. _console-command-service-lazy-loading:

Lazy Loading
Expand Down
11 changes: 0 additions & 11 deletions controller/argument_value_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ In addition, some components and official bundles provide other value resolvers:
the controller can be accessed by anonymous users. It requires installing
the :doc:`Security component </components/security>`.

:class:`Symfony\\Bundle\\SecurityBundle\\SecurityUserValueResolver`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow (unrelated to this PR), this is such an implementation detail that I would even vote to completely remove it from 4.2 docs (and just replace the class name and act like nothing changed, it doesn't matter for a framework user)

Injects the object that represents the current logged in user if type-hinted
with ``UserInterface``. Default value can be set to ``null`` in case
the controller can be accessed by anonymous users. It requires installing
the `SecurityBundle`_.

.. deprecated:: 4.1

The ``SecurityUserValueResolver`` was deprecated in Symfony 4.1 in favor of
:class:`Symfony\\Component\\Security\\Http\\Controller\\UserValueResolver`.

``Psr7ServerRequestResolver``
Injects a `PSR-7`_ compliant version of the current request if type-hinted
with ``RequestInterface``, ``MessageInterface`` or ``ServerRequestInterface``.
Expand Down
8 changes: 1 addition & 7 deletions controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,13 @@ There are some important things to consider in the code of the above controller:
users. This also applies to the files uploaded by your visitors. The ``UploadedFile``
class provides methods to get the original file extension
(:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getExtension`),
the original file size (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getClientSize`)
the original file size (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getSize`)
and the original file name (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getClientOriginalName`).
However, they are considered *not safe* because a malicious user could tamper
that information. That's why it's always better to generate a unique name and
use the :method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::guessExtension`
method to let Symfony guess the right extension according to the file MIME type;

.. deprecated:: 4.1

The :method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getClientSize`
method was deprecated in Symfony 4.1 and will be removed in Symfony 5.0.
Use ``getSize()`` instead.

You can use the following code to link to the PDF brochure of a product:

.. code-block:: html+twig
Expand Down
6 changes: 0 additions & 6 deletions form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,6 @@ link for details), create a ``shipping_widget`` block to handle this:
{% endspaceless %}
{% endblock %}

.. note::

Symfony 4.2 deprecated calling ``FormRenderer::searchAndRenderBlock`` for
fields that have already been rendered. That's why the previous example
includes the ``... if not child.rendered`` statement.

.. tip::

You can further customize the template used to render each children of the
Expand Down
138 changes: 0 additions & 138 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,6 @@ Configuration
* `storage_id`_
* `use_cookies`_

* `templating`_

* :ref:`cache <reference-templating-cache>`
* `engines`_
* :ref:`form <reference-templating-form>`

* `resources`_

* `loaders`_

* `test`_
* `translator`_

Expand Down Expand Up @@ -224,7 +214,6 @@ Configuration
* `endpoint`_

* `static_method`_
* `strict_email`_
* `translation_domain`_

* `workflows`_
Expand Down Expand Up @@ -1847,119 +1836,6 @@ package:
If you request an asset that is *not found* in the ``manifest.json`` file, the original -
*unmodified* - asset path will be returned.

templating
~~~~~~~~~~

.. _reference-templating-form:

form
....

resources
"""""""""

**type**: ``string[]`` **default**: ``['FrameworkBundle:Form']``

.. deprecated:: 4.3

The integration of the Templating component in FrameworkBundle has been
deprecated since version 4.3 and will be removed in 5.0. Form theming with
PHP templates will no longer be supported and you'll need to use Twig instead.

A list of all resources for form theming in PHP. This setting is not required
if you're :ref:`using the Twig format for your themes <forms-theming-twig>`.

Assume you have custom global form themes in ``templates/form_themes/``, you can
configure this like:

.. configuration-block::

.. code-block:: yaml

# config/packages/framework.yaml
framework:
templating:
form:
resources:
- 'form_themes'

.. code-block:: xml

<!-- config/packages/framework.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">

<framework:config>
<framework:templating>
<framework:form>
<framework:resource>form_themes</framework:resource>
</framework:form>
</framework:templating>
</framework:config>
</container>

.. code-block:: php

// config/packages/framework.php
$container->loadFromExtension('framework', [
'templating' => [
'form' => [
'resources' => [
'form_themes',
],
],
],
]);

.. note::

The default form templates from ``FrameworkBundle:Form`` will always
be included in the form resources.

.. seealso::

See :ref:`forms-theming-global` for more information.

.. _reference-templating-cache:

cache
.....

**type**: ``string``

The path to the cache directory for templates. When this is not set, caching
is disabled.

.. note::

When using Twig templating, the caching is already handled by the
TwigBundle and doesn't need to be enabled for the FrameworkBundle.

engines
.......

**type**: ``string[]`` / ``string`` **required**

The Templating Engine to use. This can either be a string (when only one
engine is configured) or an array of engines.

At least one engine is required.

loaders
.......

**type**: ``string[]``

An array (or a string when configuring just one loader) of service ids for
templating loaders. Templating loaders are used to find and load templates
from a resource (e.g. a filesystem or database). Templating loaders must
implement :class:`Symfony\\Component\\Templating\\Loader\\LoaderInterface`.

translator
~~~~~~~~~~

Expand Down Expand Up @@ -2155,20 +2031,6 @@ metadata of the class. You can define an array of strings with the names of
several methods. In that case, all of them will be called in that order to load
the metadata.

strict_email
............

**type**: ``Boolean`` **default**: ``false``

.. deprecated:: 4.1

The ``strict_email`` option was deprecated in Symfony 4.1. Use the new
``email_validation_mode`` option instead.

If this option is enabled, the `egulias/email-validator`_ library will be
used by the :doc:`/reference/constraints/Email` constraint validator. Otherwise,
the validator uses a simple regular expression to validate email addresses.

email_validation_mode
.....................

Expand Down
30 changes: 6 additions & 24 deletions reference/configuration/kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ Configuration
-------------

* `Charset`_
* `Kernel Name`_
* `Project Directory`_
* `Cache Directory`_
* `Log Directory`_
* `Container Build Time`_

In previous Symfony versions there was another configuration option to define
the "kernel name", which is only important when
:doc:`using applications with multiple kernels </configuration/multiple_kernels>`.
If you need a unique ID for your kernels use the ``kernel.container_class``
parameter or the ``Kernel::getContainerClass()`` method.

.. _configuration-kernel-charset:

Charset
Expand All @@ -44,29 +49,6 @@ charset::
}
}

Kernel Name
~~~~~~~~~~~

**type**: ``string`` **default**: ``src`` (i.e. the directory name holding
the kernel class)

.. deprecated:: 4.2

The ``kernel.name`` parameter and the ``Kernel::getName()`` method were
deprecated in Symfony 4.2. If you need a unique ID for your kernels use the
``kernel.container_class`` parameter or the ``Kernel::getContainerClass()`` method.

The name of the kernel isn't usually directly important - it's used in the
generation of cache files - and you probably will only change it when
:doc:`using applications with multiple kernels </configuration/multiple_kernels>`.

This value is exposed via the ``kernel.name`` configuration parameter and the
:method:`Symfony\\Component\\HttpKernel\\Kernel::getName` method.

To change this setting, override the ``getName()`` method. Alternatively, move
your kernel into a different directory. For example, if you moved the kernel
into a ``foo/`` directory (instead of ``src/``), the kernel name will be ``foo``.

.. _configuration-kernel-project-directory:

Project Directory
Expand Down
Loading