From 291cded9c71731284f03ab10d9bcb7da0ca26420 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 1 Jun 2023 11:36:26 +0200 Subject: [PATCH 01/99] Upgrade the minimum PHP version requirement for Symfony 7.0 --- setup.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.rst b/setup.rst index 7bb5a8010a2..b75335c9dd6 100644 --- a/setup.rst +++ b/setup.rst @@ -14,7 +14,7 @@ Technical Requirements Before creating your first Symfony application you must: -* Install PHP 8.1 or higher and these PHP extensions (which are installed and +* Install PHP 8.2 or higher and these PHP extensions (which are installed and enabled by default in most PHP 8 installations): `Ctype`_, `iconv`_, `PCRE`_, `Session`_, `SimpleXML`_, and `Tokenizer`_; * `Install Composer`_, which is used to install PHP packages. From 68f135862f28f388b90ae9196380697f80e7ba08 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 5 Jun 2023 08:37:14 +0200 Subject: [PATCH 02/99] Update setup docs for Symfony 7.0 --- setup.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.rst b/setup.rst index e8f3ee791a2..0ad060d8480 100644 --- a/setup.rst +++ b/setup.rst @@ -46,10 +46,10 @@ application: .. code-block:: terminal # run this if you are building a traditional web application - $ symfony new my_project_directory --version="6.4.*@dev" --webapp + $ symfony new my_project_directory --version="7.0.*@dev" --webapp # run this if you are building a microservice, console application or API - $ symfony new my_project_directory --version="6.4.*@dev" + $ symfony new my_project_directory --version="7.0.*@dev" The only difference between these two commands is the number of packages installed by default. The ``--webapp`` option installs all the packages that you @@ -61,12 +61,12 @@ Symfony application using Composer: .. code-block:: terminal # run this if you are building a traditional web application - $ composer create-project symfony/skeleton:"6.4.*@dev" my_project_directory + $ composer create-project symfony/skeleton:"7.0.*@dev" my_project_directory $ cd my_project_directory $ composer require webapp # run this if you are building a microservice, console application or API - $ composer create-project symfony/skeleton:"6.4.*@dev" my_project_directory + $ composer create-project symfony/skeleton:"7.0.*@dev" my_project_directory No matter which command you run to create the Symfony application. All of them will create a new ``my_project_directory/`` directory, download some dependencies From 2d674cf6abd9716fbfc71e3c00e6f54f56a1f78f Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Fri, 30 Jun 2023 14:04:31 +0200 Subject: [PATCH 03/99] [Console] Remove occurrences of `$defaultName` and `$defaultDescription` --- console.rst | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/console.rst b/console.rst index 4038c16f83e..edac5545e9e 100644 --- a/console.rst +++ b/console.rst @@ -146,13 +146,12 @@ You can optionally define a description, help message and the // ... class CreateUserCommand extends Command { - // the command description shown when running "php bin/console list" - protected static $defaultDescription = 'Creates a new user.'; - // ... protected function configure(): void { $this + // the command description shown when running "php bin/console list" + ->setDescription('Creates a new user.') // the command help shown when running the command with the "--help" option ->setHelp('This command allows you to create a user...') ; @@ -161,15 +160,16 @@ You can optionally define a description, help message and the .. tip:: - Defining the ``$defaultDescription`` static property instead of using the - ``setDescription()`` method allows to get the command description without + Using the ``#[AsCommand]`` attribute to define a description instead of + using the ``setDescription()`` method allows to get the command description without instantiating its class. This makes the ``php bin/console list`` command run much faster. If you want to always run the ``list`` command fast, add the ``--short`` option to it (``php bin/console list --short``). This will avoid instantiating command classes, but it won't show any description for commands that use the - ``setDescription()`` method instead of the static property. + ``setDescription()`` method instead of the attribute to define the command + description. The ``configure()`` method is called automatically at the end of the command constructor. If your command defines its own constructor, set the properties @@ -216,8 +216,6 @@ You can register the command by adding the ``AsCommand`` attribute to it:: use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; - // the "name" and "description" arguments of AsCommand replace the - // static $defaultName and $defaultDescription properties #[AsCommand( name: 'app:create-user', description: 'Creates a new user.', From 1a68fb07e9ecb73b108dad68183f04aaf2aae2ed Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Fri, 30 Jun 2023 18:05:09 +0200 Subject: [PATCH 04/99] [HttpKernel] Remove `ContainerAwareInterface` occurrence --- components/http_kernel.rst | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/components/http_kernel.rst b/components/http_kernel.rst index 90e0194f529..937028c28a4 100644 --- a/components/http_kernel.rst +++ b/components/http_kernel.rst @@ -258,18 +258,6 @@ on the request's information. b) A new instance of your controller class is instantiated with no constructor arguments. - c) If the controller implements :class:`Symfony\\Component\\DependencyInjection\\ContainerAwareInterface`, - ``setContainer()`` is called on the controller object and the container - is passed to it. This step is also specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver` - sub-class used by the Symfony Framework. - -.. deprecated:: 6.4 - - :class:`Symfony\\Component\\DependencyInjection\\ContainerAwareInterface` and - :class:`Symfony\\Component\\DependencyInjection\\ContainerAwareTrait` are - deprecated since Symfony 6.4. Dependency injection should be used instead to - access the service container. - .. _component-http-kernel-kernel-controller: 3) The ``kernel.controller`` Event From e46a7a0a28d9740ed8590d4bc67522c644f8c3b7 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Fri, 30 Jun 2023 19:48:14 +0200 Subject: [PATCH 05/99] Remove deprecated directive --- reference/forms/types/options/model_timezone.rst.inc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/reference/forms/types/options/model_timezone.rst.inc b/reference/forms/types/options/model_timezone.rst.inc index 44050e89219..0ef0efe1b56 100644 --- a/reference/forms/types/options/model_timezone.rst.inc +++ b/reference/forms/types/options/model_timezone.rst.inc @@ -6,10 +6,4 @@ Timezone that the input data is stored in. This must be one of the `PHP supported timezones`_. -.. deprecated:: 6.4 - - Starting from Symfony 6.4, it's deprecated to pass ``DateTime`` or ``DateTimeImmutable`` - values to this form field with a different timezone than the one configured with - the ``model_timezone`` option. - .. _`PHP supported timezones`: https://www.php.net/manual/en/timezones.php From ba5059e10fa24b62501e79f0fd9f2e81ba321fb2 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 4 Jul 2023 10:13:58 +0200 Subject: [PATCH 06/99] [ExpressionLanguage] `in` and `not in` operators are using strict comparison --- reference/formats/expression_language.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/reference/formats/expression_language.rst b/reference/formats/expression_language.rst index 18811c0ca44..ebb7574922c 100644 --- a/reference/formats/expression_language.rst +++ b/reference/formats/expression_language.rst @@ -352,12 +352,9 @@ For example:: The ``$inGroup`` would evaluate to ``true``. -.. deprecated:: 6.3 +.. note:: - In Symfony versions previous to 6.3, ``in`` and ``not in`` operators - were using loose comparison. Using these operators with variables of - different types is now deprecated, and these operators will be using - strict comparison from Symfony 7.0. + The ``in`` and ``not in`` operators are using strict comparison. Numeric Operators ~~~~~~~~~~~~~~~~~ From b44d4c41f5cb0247639f745ec983c60b1328b531 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 4 Jul 2023 14:12:02 +0200 Subject: [PATCH 07/99] [Validator] Remove deprecated `ExpressionLanguageSyntax` constraint --- .../constraints/ExpressionLanguageSyntax.rst | 127 ------------------ reference/constraints/ExpressionSyntax.rst | 6 - 2 files changed, 133 deletions(-) delete mode 100644 reference/constraints/ExpressionLanguageSyntax.rst diff --git a/reference/constraints/ExpressionLanguageSyntax.rst b/reference/constraints/ExpressionLanguageSyntax.rst deleted file mode 100644 index f10956c4046..00000000000 --- a/reference/constraints/ExpressionLanguageSyntax.rst +++ /dev/null @@ -1,127 +0,0 @@ -ExpressionLanguageSyntax -======================== - -.. deprecated:: 6.1 - - This constraint is deprecated since Symfony 6.1. Instead, use the - :doc:`ExpressionSyntax ` constraint. - -This constraint checks that the value is valid as an `ExpressionLanguage`_ -expression. - -========== =================================================================== -Applies to :ref:`property or method ` -Class :class:`Symfony\\Component\\Validator\\Constraints\\ExpressionLanguageSyntax` -Validator :class:`Symfony\\Component\\Validator\\Constraints\\ExpressionLanguageSyntaxValidator` -========== =================================================================== - -Basic Usage ------------ - -The following constraints ensure that: - -* the ``promotion`` property stores a value which is valid as an - ExpressionLanguage expression; -* the ``shippingOptions`` property also ensures that the expression only uses - certain variables. - -.. configuration-block:: - - .. code-block:: php-attributes - - // src/Entity/Order.php - namespace App\Entity; - - use Symfony\Component\Validator\Constraints as Assert; - - class Order - { - #[Assert\ExpressionLanguageSyntax] - protected string $promotion; - - #[Assert\ExpressionLanguageSyntax( - allowedVariables: ['user', 'shipping_centers'], - )] - protected string $shippingOptions; - } - - .. code-block:: yaml - - # config/validator/validation.yaml - App\Entity\Order: - properties: - promotion: - - ExpressionLanguageSyntax: ~ - shippingOptions: - - ExpressionLanguageSyntax: - allowedVariables: ['user', 'shipping_centers'] - - .. code-block:: xml - - - - - - - - - - - - - - - - - - .. code-block:: php - - // src/Entity/Student.php - namespace App\Entity; - - use Symfony\Component\Validator\Constraints as Assert; - use Symfony\Component\Validator\Mapping\ClassMetadata; - - class Order - { - // ... - - public static function loadValidatorMetadata(ClassMetadata $metadata): void - { - $metadata->addPropertyConstraint('promotion', new Assert\ExpressionLanguageSyntax()); - - $metadata->addPropertyConstraint('shippingOptions', new Assert\ExpressionLanguageSyntax([ - 'allowedVariables' => ['user', 'shipping_centers'], - ])); - } - } - -Options -------- - -allowedVariables -~~~~~~~~~~~~~~~~ - -**type**: ``array`` or ``null`` **default**: ``null`` - -If this option is defined, the expression can only use the variables whose names -are included in this option. Unset this option or set its value to ``null`` to -allow any variables. - -.. include:: /reference/constraints/_groups-option.rst.inc - -message -~~~~~~~ - -**type**: ``string`` **default**: ``This value should be a valid expression.`` - -This is the message displayed when the validation fails. - -.. include:: /reference/constraints/_payload-option.rst.inc - -.. _`ExpressionLanguage`: https://symfony.com/components/ExpressionLanguage diff --git a/reference/constraints/ExpressionSyntax.rst b/reference/constraints/ExpressionSyntax.rst index 2a603eaa616..c1d086790c1 100644 --- a/reference/constraints/ExpressionSyntax.rst +++ b/reference/constraints/ExpressionSyntax.rst @@ -4,12 +4,6 @@ ExpressionSyntax This constraint checks that the value is valid as an `ExpressionLanguage`_ expression. -.. versionadded:: 6.1 - - This constraint was introduced in Symfony 6.1 and deprecates the previous - :doc:`ExpressionLanguageSyntax ` - constraint. - ========== =================================================================== Applies to :ref:`property or method ` Class :class:`Symfony\\Component\\Validator\\Constraints\\ExpressionSyntax` From fc0b8994ec5e153c3fb8e2572c832a142d6cc30f Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 4 Jul 2023 14:15:16 +0200 Subject: [PATCH 08/99] [Security] Remove `{username}` occurrence --- security/ldap.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/security/ldap.rst b/security/ldap.rst index b2f5a3e753c..21ea66f480e 100644 --- a/security/ldap.rst +++ b/security/ldap.rst @@ -290,11 +290,6 @@ string will be replaced by the value of the ``uid_key`` configuration value (by default, ``sAMAccountName``), and the ``{user_identifier}`` string will be replaced by the user identified you are trying to load. -.. deprecated:: 6.2 - - Starting from Symfony 6.2, the ``{username}`` string was deprecated in favor - of ``{user_identifier}``. - For example, with a ``uid_key`` of ``uid``, and if you are trying to load the user ``fabpot``, the final string will be: ``(uid=fabpot)``. From f24c16038a8410b66f8d45553a1659084687af95 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 5 Jul 2023 09:10:28 +0200 Subject: [PATCH 09/99] [Validator] Remove the deprecated VALIDATION_MODE_LOOSE --- reference/configuration/framework.rst | 7 +------ reference/constraints/Email.rst | 10 +--------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 74de9fc1094..5c7eafe5531 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -2619,12 +2619,7 @@ constraint verifies the submitted string entropy is matching the minimum entropy email_validation_mode ..................... -**type**: ``string`` **default**: ``loose`` - -.. deprecated:: 6.2 - - The ``loose`` default value is deprecated since Symfony 6.2. Starting from - Symfony 7.0, the default value of this option will be ``html5``. +**type**: ``string`` **default**: ``html5`` Sets the default value for the :ref:`"mode" option of the Email validator `. diff --git a/reference/constraints/Email.rst b/reference/constraints/Email.rst index 19b1579b88a..3f4207471c1 100644 --- a/reference/constraints/Email.rst +++ b/reference/constraints/Email.rst @@ -104,13 +104,10 @@ Parameter Description ``mode`` ~~~~~~~~ -**type**: ``string`` **default**: (see below) +**type**: ``string`` **default**: ``html5`` This option defines the pattern used to validate the email address. Valid values are: -* ``loose`` uses a simple regular expression (just checks that at least one ``@`` - character is present, etc.). This validation is too simple and it's recommended - to use one of the other modes instead; * ``html5`` uses the regular expression of the `HTML5 email input element`_, except it enforces a tld to be present. * ``html5-allow-no-tld`` uses exactly the same regular expression as the `HTML5 email input element`_, @@ -133,11 +130,6 @@ The default value used by this option is set in the :ref:`framework.validation.email_validation_mode ` configuration option. -.. deprecated:: 6.2 - - The ``loose`` value is deprecated since Symfony 6.2. Starting from - Symfony 7.0, the default value of this option will be ``html5``. - .. include:: /reference/constraints/_normalizer-option.rst.inc .. include:: /reference/constraints/_payload-option.rst.inc From bf08b822825de7d8272ef47a76f159133a6f9252 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 5 Jul 2023 13:08:30 +0200 Subject: [PATCH 10/99] [Form] Remove the deprecated renderForm() shortcut --- forms.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/forms.rst b/forms.rst index 806d1f47bb2..3c062c76e98 100644 --- a/forms.rst +++ b/forms.rst @@ -282,13 +282,6 @@ Now that the form has been created, the next step is to render it:: Internally, the ``render()`` method calls ``$form->createView()`` to transform the form into a *form view* instance. -.. deprecated:: 6.2 - - Prior to Symfony 6.2, you had to use ``$this->render(..., ['form' => $form->createView()])`` - or the ``renderForm()`` method to render the form. The ``renderForm()`` - method is deprecated in favor of directly passing the ``FormInterface`` - instance to ``render()``. - Then, use some :ref:`form helper functions ` to render the form contents: From e6f6bbd9f584083ed327dd967de582bca7508a9a Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 5 Jul 2023 14:02:31 +0200 Subject: [PATCH 11/99] Remove `terminate_on_cache_hit` option. --- reference/configuration/framework.rst | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 0b8fd4b0bac..82e87b67f0b 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -167,27 +167,6 @@ which the cache can serve a stale response when an error is encountered (default: 60). This setting is overridden by the stale-if-error HTTP Cache-Control extension (see RFC 5861). -terminate_on_cache_hit -...................... - -**type**: ``boolean`` **default**: ``true`` - -If ``true``, the :ref:`kernel.terminate ` -event is dispatched even when the cache is hit. - -Unless your application needs to process events on cache hits, it's recommended -to set this to ``false`` to improve performance, because it avoids having to -bootstrap the Symfony framework on a cache hit. - -.. versionadded:: 6.2 - - The ``terminate_on_cache_hit`` option was introduced in Symfony 6.2. - -.. deprecated:: 6.2 - - Setting the ``terminate_on_cache_hit`` option to ``true`` was deprecated in - Symfony 6.2 and the option will be removed in Symfony 7.0. - .. _configuration-framework-http_method_override: http_method_override From 1ef9746c19cb52993f6b706dd398e6ca2ae45a5d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 5 Jul 2023 14:58:01 +0200 Subject: [PATCH 12/99] [Form] Update the default value of widget option in date/time types --- reference/forms/types/options/date_widget_description.rst.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/forms/types/options/date_widget_description.rst.inc b/reference/forms/types/options/date_widget_description.rst.inc index b86bdde5a0e..956ad8c7148 100644 --- a/reference/forms/types/options/date_widget_description.rst.inc +++ b/reference/forms/types/options/date_widget_description.rst.inc @@ -1,4 +1,4 @@ -**type**: ``string`` **default**: ``choice`` +**type**: ``string`` **default**: ``single_text`` The basic way in which this field should be rendered. Can be one of the following: From 16cb242026fa13653de2922dbed9a9194afb6348 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 5 Jul 2023 15:39:43 +0200 Subject: [PATCH 13/99] [Twig] Remove the deprecated autoescape option --- reference/configuration/twig.rst | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst index cc079da6745..d36584a7f6c 100644 --- a/reference/configuration/twig.rst +++ b/reference/configuration/twig.rst @@ -33,37 +33,6 @@ compiled again automatically. .. _config-twig-autoescape: -autoescape -~~~~~~~~~~ - -.. deprecated:: 6.1 - - This option is deprecated since Symfony 6.1. If required, use the - ``autoescape_service`` or ``autoescape_service_method`` option instead. - -**type**: ``boolean`` or ``string`` **default**: ``name`` - -If set to ``false``, automatic escaping is disabled (you can still escape each content -individually in the templates). - -.. caution:: - - Setting this option to ``false`` is dangerous and it will make your - application vulnerable to `XSS attacks`_ because most third-party bundles - assume that auto-escaping is enabled and they don't escape contents - themselves. - -If set to a string, the template contents are escaped using the strategy with -that name. Allowed values are ``html``, ``js``, ``css``, ``url``, ``html_attr`` -and ``name``. The default value is ``name``. This strategy escapes contents -according to the template name extension (e.g. it uses ``html`` for ``*.html.twig`` -templates and ``js`` for ``*.js.twig`` templates). - -.. tip:: - - See `autoescape_service`_ and `autoescape_service_method`_ to define your - own escaping strategy. - autoescape_service ~~~~~~~~~~~~~~~~~~ From 88408715d43bf8d3c16a7e17ef5a3812be078f54 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 5 Jul 2023 18:16:24 +0200 Subject: [PATCH 14/99] [Messenger] Remove remaining deprecations --- messenger.rst | 12 ------------ messenger/multiple_buses.rst | 3 --- 2 files changed, 15 deletions(-) diff --git a/messenger.rst b/messenger.rst index 5a84e517415..95ae08a8ea8 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1718,12 +1718,6 @@ during a request:: } } -.. versionadded:: 6.3 - - The namespace of the ``InMemoryTransport`` class changed in Symfony 6.3 from - ``Symfony\Component\Messenger\Transport\InMemoryTransport`` to - ``Symfony\Component\Messenger\Transport\InMemory\InMemoryTransport``. - The transport has a number of options: ``serialize`` (boolean, default: ``false``) @@ -2020,12 +2014,6 @@ A single handler class can handle multiple messages. For that add the } } -.. deprecated:: 6.2 - - Implementing the :class:`Symfony\\Component\\Messenger\\Handler\\MessageSubscriberInterface` - is another way to handle multiple messages with one handler class. This - interface was deprecated in Symfony 6.2. - Binding Handlers to Different Transports ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/messenger/multiple_buses.rst b/messenger/multiple_buses.rst index 49e4d3e568e..42ff8dc85d4 100644 --- a/messenger/multiple_buses.rst +++ b/messenger/multiple_buses.rst @@ -133,9 +133,6 @@ you can restrict each handler to a specific bus using the ``messenger.message_ha services: App\MessageHandler\SomeCommandHandler: tags: [{ name: messenger.message_handler, bus: command.bus }] - # prevent handlers from being registered twice (or you can remove - # the MessageHandlerInterface that autoconfigure uses to find handlers) - autoconfigure: false .. code-block:: xml From db47478951f9f0aa3eb643a7a6864e9e2e569170 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Thu, 6 Jul 2023 13:08:03 +0200 Subject: [PATCH 15/99] [Serializer] Add needed method and return types --- serializer/custom_normalizer.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst index 0168e0c7447..7534002da20 100644 --- a/serializer/custom_normalizer.rst +++ b/serializer/custom_normalizer.rst @@ -30,7 +30,7 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``: ) { } - public function normalize($topic, string $format = null, array $context = []) + public function normalize($topic, string $format = null, array $context = []): array { $data = $this->normalizer->normalize($topic, $format, $context); @@ -42,10 +42,17 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``: return $data; } - public function supportsNormalization($data, string $format = null, array $context = []) + public function supportsNormalization($data, string $format = null, array $context = []): bool { return $data instanceof Topic; } + + public function getSupportedTypes(?string $format): array + { + return [ + Topic::class => true, + ]; + } } Registering it in your Application From e4f0386293dcdbae694ca7b16112276e4301b659 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Thu, 6 Jul 2023 18:57:16 +0200 Subject: [PATCH 16/99] [Lock] Remove deprecated option --- components/lock.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/lock.rst b/components/lock.rst index 293eaeed84e..f92d024aac8 100644 --- a/components/lock.rst +++ b/components/lock.rst @@ -474,18 +474,12 @@ The ``MongoDbStore`` takes the following ``$options`` (depending on the first pa Option Description ============== ================================================================================================ gcProbability Should a TTL Index be created expressed as a probability from 0.0 to 1.0 (Defaults to ``0.001``) -gcProbablity Same as ``gcProbability``, see the deprecation note below database The name of the database collection The name of the collection uriOptions Array of URI options for `MongoDBClient::__construct`_ driverOptions Array of driver options for `MongoDBClient::__construct`_ ============= ================================================================================================ -.. deprecated:: 6.3 - - The ``gcProbablity`` option (notice the typo in its name) is deprecated since - Symfony 6.3, use the ``gcProbability`` option instead. - When the first parameter is a: ``MongoDB\Collection``: From a3e5a060e970e0ec63183ac4fbd81871d958b95a Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 5 Jul 2023 15:35:41 +0200 Subject: [PATCH 17/99] [Translation] Update the PHP extraction information for Symfony 7.0 --- reference/dic_tags.rst | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 7b953e20e3c..b003ca683b2 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -1071,23 +1071,16 @@ file When executing the ``translation:extract`` command, it uses extractors to extract translation messages from a file. By default, the Symfony Framework -has a :class:`Symfony\\Bridge\\Twig\\Translation\\TwigExtractor` and a PHP -extractor to find and extract translation keys from Twig templates and PHP files. +has a :class:`Symfony\\Bridge\\Twig\\Translation\\TwigExtractor` to find and +extract translation keys from Twig templates. -Symfony includes two PHP extractors: :class:`Symfony\\Component\\Translation\\Extractor\\PhpExtractor` -and :class:`Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor`. The -first one is simple but doesn't require to install any packages; the second one -is much more advanced, but requires to install this dependency in your project: +If you also want to find and extract translation keys from PHP files, install +the following dependency to activate the :class:`Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor`: .. code-block:: terminal $ composer require nikic/php-parser -.. deprecated:: 6.2 - - The ``PhpExtractor`` class is deprecated since Symfony 6.2. The ``PhpAstExtractor`` - class will be the only PHP extractor available starting from Symfony 7.0. - You can create your own extractor by creating a class that implements :class:`Symfony\\Component\\Translation\\Extractor\\ExtractorInterface` and tagging the service with ``translation.extractor``. The tag has one From 699a89fa7c1f7b694171287634c3d8e90e2b58c8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 5 Jul 2023 15:05:23 +0200 Subject: [PATCH 18/99] Update the default value of the http_method_override option --- reference/configuration/framework.rst | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 03f46ae6d31..d7431bb264d 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -172,7 +172,7 @@ Cache-Control extension (see RFC 5861). http_method_override ~~~~~~~~~~~~~~~~~~~~ -**type**: ``boolean`` **default**: (see explanation below) +**type**: ``boolean`` **default**: ``false`` This determines whether the ``_method`` request parameter is used as the intended HTTP method on POST requests. If enabled, the @@ -180,18 +180,6 @@ intended HTTP method on POST requests. If enabled, the method gets called automatically. It becomes the service container parameter named ``kernel.http_method_override``. -The **default value** is: - -* ``true``, if you have an existing application that you've upgraded from an older - Symfony version without resyncing the :doc:`Symfony Flex ` recipes; -* ``false``, if you've created a new Symfony application or updated the Symfony - Flex recipes. This is also the default value starting from Symfony 7.0. - -.. deprecated:: 6.1 - - Not setting a value explicitly for this option is deprecated since Symfony 6.1 - because the default value will change to ``false`` in Symfony 7.0. - .. seealso:: :ref:`Changing the Action and HTTP Method ` of From 039ba692a58e81ff5fb2c010789740b8d550688d Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Mon, 10 Jul 2023 09:30:03 +0200 Subject: [PATCH 19/99] [HTTPClient] Add documentation for `HarFileResponseFactory` Fixes https://github.com/symfony/symfony-docs/issues/18546 --- http_client.rst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/http_client.rst b/http_client.rst index 3dd9e867bc1..c11bde2d15c 100644 --- a/http_client.rst +++ b/http_client.rst @@ -2196,6 +2196,45 @@ test it in a real application:: } } +Testing using HAR files +~~~~~~~~~~~~~~~~~~~~~~~ + +The previous example can also be achieved using `HAR`_ files. You can export those files from all modern browsers (from the network tab) & +HTTP Clients. First, do the HTTP request(s) you want to test in your favorite HTTP Client / Browser, then store generated ``.har`` file somewhere in your application:: + + // ExternalArticleServiceTest.php + use PHPUnit\Framework\TestCase; + use Symfony\Component\HttpClient\MockHttpClient; + use Symfony\Component\HttpClient\Response\MockResponse; + + final class ExternalArticleServiceTest extends TestCase + { + public function testSubmitData(): void + { + // Arrange + $fixtureDir = sprintf('%s/tests/fixtures/HTTP', static::getContainer()->getParameter('kernel.project_dir')); + $factory = new HarFileResponseFactory("$fixtureDir/example.com_archive.har"); + $httpClient = new MockHttpClient($factory, 'https://example.com'); + $service = new ExternalArticleService($httpClient); + + // Act + $responseData = $service->createArticle($requestData); + + // Assert + self::assertSame($responseData, 'the expected response'); + } + } + + +If your service does multiple requests or if your `.har` file contains multiple request / response pairs, +the :class:`Symfony\\Component\\HttpClient\\Test\\HarFileResponseFactory` will find the associated response based on +the request method, url and body (if any). Note that **this doesn't work** if the request body or uri is random / always changing +(if it contains current date or random UUID(s) for example). + +.. versionadded:: 7.0 + + The ``HarFileResponseFactory`` was introduced in Symfony 7.0. + Testing Network Transport Exceptions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2262,3 +2301,4 @@ you to do so, by yielding the exception from its body:: .. _`idempotent method`: https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Idempotent_methods .. _`SSRF`: https://portswigger.net/web-security/ssrf .. _`RFC 6570`: https://www.rfc-editor.org/rfc/rfc6570 +.. _`HAR`: https://w3c.github.io/web-performance/specs/HAR/Overview.html From bc8d4763b700a138463629b50aa685ae160b9924 Mon Sep 17 00:00:00 2001 From: Maxime Doutreluingne Date: Sun, 9 Jul 2023 11:05:12 +0200 Subject: [PATCH 20/99] [Notifier] Remove the Sendinblue bridge --- notifier.rst | 2 -- reference/configuration/twig.rst | 1 - 2 files changed, 3 deletions(-) diff --git a/notifier.rst b/notifier.rst index 27a10a2a766..626b23f14f1 100644 --- a/notifier.rst +++ b/notifier.rst @@ -85,7 +85,6 @@ Service Package DSN `Redlink`_ ``symfony/redlink-notifier`` ``redlink://API_KEY:APP_KEY@default?from=SENDER_NAME&version=API_VERSION`` `RingCentral`_ ``symfony/ring-central-notifier`` ``ringcentral://API_TOKEN@default?from=FROM`` `Sendberry`_ ``symfony/sendberry-notifier`` ``sendberry://USERNAME:PASSWORD@default?auth_key=AUTH_KEY&from=FROM`` -`Sendinblue`_ ``symfony/sendinblue-notifier`` ``sendinblue://API_KEY@default?sender=PHONE`` `Sms77`_ ``symfony/sms77-notifier`` ``sms77://API_KEY@default?from=FROM`` `SimpleTextin`_ ``symfony/simple-textin-notifier`` ``simpletextin://API_KEY@default?from=FROM`` `Sinch`_ ``symfony/sinch-notifier`` ``sinch://ACCOUNT_ID:AUTH_TOKEN@default?from=FROM`` @@ -1024,7 +1023,6 @@ is dispatched. Listeners receive a .. _`RocketChat`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/RocketChat/README.md .. _`SMSFactor`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/SmsFactor/README.md .. _`Sendberry`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Sendberry/README.md -.. _`Sendinblue`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Sendinblue/README.md .. _`SimpleTextin`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/SimpleTextin/README.md .. _`Sinch`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Sinch/README.md .. _`Slack`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Slack/README.md diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst index d36584a7f6c..6de8ef24742 100644 --- a/reference/configuration/twig.rst +++ b/reference/configuration/twig.rst @@ -402,4 +402,3 @@ attribute or method doesn't exist. If set to ``false`` these errors are ignored and the non-existing values are replaced by ``null``. .. _`the optimizer extension`: https://twig.symfony.com/doc/3.x/api.html#optimizer-extension -.. _`XSS attacks`: https://en.wikipedia.org/wiki/Cross-site_scripting From ec88f6d96d136b603388326209e84bf131b121b9 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 10 Jul 2023 11:48:50 +0200 Subject: [PATCH 21/99] Tweaks --- notifier.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/notifier.rst b/notifier.rst index a8ddf6374c0..47aad3d263a 100644 --- a/notifier.rst +++ b/notifier.rst @@ -121,11 +121,6 @@ Service Package DSN The `Redlink`_ and `Brevo`_ integrations were introduced in Symfony 6.4. -.. deprecated:: 6.4 - - The `Sendinblue`_ integration is deprecated since - Symfony 6.4, use the `Brevo`_ integration instead. - To enable a texter, add the correct DSN in your ``.env`` file and configure the ``texter_transports``: From 71f2f821de2a8f28c456152cb54b531670947a53 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 10 Jul 2023 13:18:01 +0200 Subject: [PATCH 22/99] Minor rewords --- http_client.rst | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/http_client.rst b/http_client.rst index c11bde2d15c..bc0a17b581a 100644 --- a/http_client.rst +++ b/http_client.rst @@ -2196,11 +2196,15 @@ test it in a real application:: } } -Testing using HAR files +Testing Using HAR Files ~~~~~~~~~~~~~~~~~~~~~~~ -The previous example can also be achieved using `HAR`_ files. You can export those files from all modern browsers (from the network tab) & -HTTP Clients. First, do the HTTP request(s) you want to test in your favorite HTTP Client / Browser, then store generated ``.har`` file somewhere in your application:: +Modern browsers (via their network tab) and HTTP clients allow to export the +information of one or more HTTP requests using the `HAR`_ (HTTP Archive) format. +You can use those ``.har`` files to perform tests with Symfony's HTTP Client. + +First, use a browser or HTTP client to perform the HTTP request(s) you want to +test. Then, save that information as a ``.har`` file somewhere in your application:: // ExternalArticleServiceTest.php use PHPUnit\Framework\TestCase; @@ -2225,11 +2229,11 @@ HTTP Clients. First, do the HTTP request(s) you want to test in your favorite HT } } - -If your service does multiple requests or if your `.har` file contains multiple request / response pairs, -the :class:`Symfony\\Component\\HttpClient\\Test\\HarFileResponseFactory` will find the associated response based on -the request method, url and body (if any). Note that **this doesn't work** if the request body or uri is random / always changing -(if it contains current date or random UUID(s) for example). +If your service performs multiple requests or if your ``.har`` file contains multiple +request/response pairs, the :class:`Symfony\\Component\\HttpClient\\Test\\HarFileResponseFactory` +will find the associated response based on the request method, URL and body (if any). +Note that **this won't work** if the request body or URI is random / always +changing (e.g. if it contains current date or random UUIDs). .. versionadded:: 7.0 From 0068934b5c574e1a611d4f84eb8291bbab356f91 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 11 Jul 2023 16:42:40 +0200 Subject: [PATCH 23/99] [Bridges][Bundles] Convert to native return types --- bundles/configuration.rst | 4 ++-- bundles/extension.rst | 2 +- bundles/prepend_extension.rst | 2 +- components/console/changing_default_command.rst | 6 ++++-- components/console/console_arguments.rst | 4 ++-- components/console/logger.rst | 4 +++- components/dependency_injection/compilation.rst | 2 +- configuration/using_parameters_in_dic.rst | 2 +- console/calling_commands.rst | 2 +- console/verbosity.rst | 2 +- logging/monolog_console.rst | 4 +++- session.rst | 4 ++-- 12 files changed, 22 insertions(+), 16 deletions(-) diff --git a/bundles/configuration.rst b/bundles/configuration.rst index bc9efc1e0b9..366eec0d72c 100644 --- a/bundles/configuration.rst +++ b/bundles/configuration.rst @@ -458,7 +458,7 @@ the extension. You might want to change this to a more professional URL:: { // ... - public function getNamespace() + public function getNamespace(): string { return 'http://acme_company.com/schema/dic/hello'; } @@ -490,7 +490,7 @@ can place it anywhere you like. You should return this path as the base path:: { // ... - public function getXsdValidationBasePath() + public function getXsdValidationBasePath(): string { return __DIR__.'/../Resources/config/schema'; } diff --git a/bundles/extension.rst b/bundles/extension.rst index f831efdaf5b..82c8fb05183 100644 --- a/bundles/extension.rst +++ b/bundles/extension.rst @@ -34,7 +34,7 @@ This is how the extension of an AcmeHelloBundle should look like:: class AcmeHelloExtension extends Extension { - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { // ... you'll load the files here later } diff --git a/bundles/prepend_extension.rst b/bundles/prepend_extension.rst index 8d28080470f..b94b647671e 100644 --- a/bundles/prepend_extension.rst +++ b/bundles/prepend_extension.rst @@ -31,7 +31,7 @@ To give an Extension the power to do this, it needs to implement { // ... - public function prepend(ContainerBuilder $container) + public function prepend(ContainerBuilder $container): void { // ... } diff --git a/components/console/changing_default_command.rst b/components/console/changing_default_command.rst index f8b100993a9..b739e3b39ba 100644 --- a/components/console/changing_default_command.rst +++ b/components/console/changing_default_command.rst @@ -15,14 +15,16 @@ name to the ``setDefaultCommand()`` method:: #[AsCommand(name: 'hello:world')] class HelloWorldCommand extends Command { - protected function configure() + protected function configure(): void { $this->setDescription('Outputs "Hello World"'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln('Hello World'); + + return Command::SUCCESS; } } diff --git a/components/console/console_arguments.rst b/components/console/console_arguments.rst index d7bf141f4ce..da538ac78f1 100644 --- a/components/console/console_arguments.rst +++ b/components/console/console_arguments.rst @@ -22,7 +22,7 @@ Have a look at the following command that has three options:: #[AsCommand(name: 'demo:args', description: 'Describe args behaviors')] class DemoArgsCommand extends Command { - protected function configure() + protected function configure(): void { $this ->setDefinition( @@ -34,7 +34,7 @@ Have a look at the following command that has three options:: ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { // ... } diff --git a/components/console/logger.rst b/components/console/logger.rst index afeab7dd0cb..5aa72a9d02d 100644 --- a/components/console/logger.rst +++ b/components/console/logger.rst @@ -44,12 +44,14 @@ You can rely on the logger to use this dependency inside a command:: )] class MyCommand extends Command { - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $logger = new ConsoleLogger($output); $myDependency = new MyDependency($logger); $myDependency->doStuff(); + + return Command::SUCCESS; } } diff --git a/components/dependency_injection/compilation.rst b/components/dependency_injection/compilation.rst index 1f450df28ed..64209c1586c 100644 --- a/components/dependency_injection/compilation.rst +++ b/components/dependency_injection/compilation.rst @@ -408,7 +408,7 @@ class implementing the ``CompilerPassInterface``:: class CustomPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { // ... do something during the compilation } diff --git a/configuration/using_parameters_in_dic.rst b/configuration/using_parameters_in_dic.rst index 05008114e01..259a0b9d974 100644 --- a/configuration/using_parameters_in_dic.rst +++ b/configuration/using_parameters_in_dic.rst @@ -135,7 +135,7 @@ And set it in the constructor of ``Configuration`` via the ``Extension`` class:: { // ... - public function getConfiguration(array $config, ContainerBuilder $container) + public function getConfiguration(array $config, ContainerBuilder $container): Configuration { return new Configuration($container->getParameter('kernel.debug')); } diff --git a/console/calling_commands.rst b/console/calling_commands.rst index 001dc47e35e..089688767fe 100644 --- a/console/calling_commands.rst +++ b/console/calling_commands.rst @@ -27,7 +27,7 @@ method):: { // ... - protected function execute(InputInterface $input, OutputInterface $output): void + protected function execute(InputInterface $input, OutputInterface $output): int { $command = $this->getApplication()->find('demo:greet'); diff --git a/console/verbosity.rst b/console/verbosity.rst index 7df68d30f23..f7a1a1e5e59 100644 --- a/console/verbosity.rst +++ b/console/verbosity.rst @@ -69,7 +69,7 @@ level. For example:: OutputInterface::VERBOSITY_VERBOSE ); - return 0; + return Command::SUCCESS; } } diff --git a/logging/monolog_console.rst b/logging/monolog_console.rst index ad06cfabbff..8d296883b50 100644 --- a/logging/monolog_console.rst +++ b/logging/monolog_console.rst @@ -47,10 +47,12 @@ The example above could then be rewritten as:: ) { } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->logger->debug('Some info'); $this->logger->notice('Some more info'); + + return Command::SUCCESS; } } diff --git a/session.rst b/session.rst index 1dcbaa71b4b..2f8848f860b 100644 --- a/session.rst +++ b/session.rst @@ -1464,7 +1464,7 @@ event:: ) { } - public function onInteractiveLogin(InteractiveLoginEvent $event) + public function onInteractiveLogin(InteractiveLoginEvent $event): void { $user = $event->getAuthenticationToken()->getUser(); @@ -1473,7 +1473,7 @@ event:: } } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ SecurityEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin', From 7b9f807a7b56e1886530865504dda235a0d779e1 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 17 Jul 2023 13:38:11 +0200 Subject: [PATCH 24/99] [Serializer] Remove `CacheableSupportsMethodInterface` --- serializer/custom_normalizer.rst | 41 ++++---------------------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst index ec121a2f54b..25528fff54e 100644 --- a/serializer/custom_normalizer.rst +++ b/serializer/custom_normalizer.rst @@ -63,8 +63,8 @@ a service and :doc:`tagged ` with ``serializer.normaliz If you're using the :ref:`default services.yaml configuration `, this is done automatically! -Performance ------------ +Performance of Normalizers/Denormalizers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To figure which normalizer (or denormalizer) must be used to handle an object, the :class:`Symfony\\Component\\Serializer\\Serializer` class will call the @@ -72,39 +72,10 @@ the :class:`Symfony\\Component\\Serializer\\Serializer` class will call the (or :method:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface::supportsDenormalization`) of all registered normalizers (or denormalizers) in a loop. -The result of these methods can vary depending on the object to serialize, the -format and the context. That's why the result **is not cached** by default and -can result in a significant performance bottleneck. - -However, most normalizers (and denormalizers) always return the same result when -the object's type and the format are the same, so the result can be cached. To -do so, make those normalizers (and denormalizers) implement the -:class:`Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface` -and return ``true`` when -:method:`Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface::hasCacheableSupportsMethod` -is called. - -.. note:: - - All built-in :ref:`normalizers and denormalizers ` - as well the ones included in `API Platform`_ natively implement this interface. - -.. deprecated:: 6.3 - - The :class:`Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface` - interface is deprecated since Symfony 6.3. You should implement the - ``getSupportedTypes()`` method instead, as shown in the section below. - -Improving Performance of Normalizers/Denormalizers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. versionadded:: 6.3 - - The ``getSupportedTypes()`` method was introduced in Symfony 6.3. - -Both :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface` +Additionally, both +:class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface` and :class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface` -contain a new method ``getSupportedTypes()``. This method allows normalizers or +contain the ``getSupportedTypes()`` method. This method allows normalizers or denormalizers to declare the type of objects they can handle, and whether they are cacheable. With this info, even if the ``supports*()`` call is not cacheable, the Serializer can skip a ton of method calls to ``supports*()`` improving @@ -148,5 +119,3 @@ Here is an example of how to use the ``getSupportedTypes()`` method:: Note that ``supports*()`` method implementations should not assume that ``getSupportedTypes()`` has been called before. - -.. _`API Platform`: https://api-platform.com From 0fd8f8fa532a3bafed52504670f4ad339b34a712 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 24 Jul 2023 14:21:18 +0200 Subject: [PATCH 25/99] [Serializer] Custom normalizer update --- serializer/custom_normalizer.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst index 25528fff54e..58e6ef2d075 100644 --- a/serializer/custom_normalizer.rst +++ b/serializer/custom_normalizer.rst @@ -12,7 +12,10 @@ Creating a New Normalizer Imagine you want add, modify, or remove some properties during the serialization process. For that you'll have to create your own normalizer. But it's usually preferable to let Symfony normalize the object, then hook into the normalization -to customize the normalized data. To do that, leverage the ``ObjectNormalizer``:: +to customize the normalized data. To do that, leverage the +``NormalizerAwareInterface`` and the ``NormalizerAwareTrait``. This will give +you access to a ``$normalizer`` property which takes care of most of the +normalization process:: // src/Serializer/TopicNormalizer.php namespace App\Serializer; @@ -20,13 +23,13 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``: use App\Entity\Topic; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; - use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; - class TopicNormalizer implements NormalizerInterface + class TopicNormalizer implements NormalizerInterface, NormalizerAwareInterface { + use NormalizerAwareTrait; + public function __construct( private UrlGeneratorInterface $router, - private ObjectNormalizer $normalizer, ) { } From 4927b6e38bf0cf6aefc1ddf50e5a15b92e583cd2 Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Mon, 24 Jul 2023 15:45:26 +0200 Subject: [PATCH 26/99] [Security] Remove deprecated XML config --- security/custom_authenticator.rst | 2 +- security/entry_point.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/security/custom_authenticator.rst b/security/custom_authenticator.rst index d9debbb1fb0..f2d7fb57c14 100644 --- a/security/custom_authenticator.rst +++ b/security/custom_authenticator.rst @@ -105,7 +105,7 @@ The authenticator can be enabled using the ``custom_authenticators`` setting: http://symfony.com/schema/dic/security https://symfony.com/schema/dic/security/security-1.0.xsd"> - + diff --git a/security/entry_point.rst b/security/entry_point.rst index e99a4039fcb..b23f45db957 100644 --- a/security/entry_point.rst +++ b/security/entry_point.rst @@ -42,7 +42,7 @@ You can configure this using the ``entry_point`` setting: http://symfony.com/schema/dic/security https://symfony.com/schema/dic/security/security-1.0.xsd"> - + @@ -248,7 +243,7 @@ listener in the Symfony application by creating a new service for it and // this is the only required option for the lifecycle listener tag 'event' => 'postPersist', - // listeners can define their priority in case multiple subscribers or listeners are associated + // listeners can define their priority in case multiple listeners are associated // to the same event (default priority = 0; higher numbers = listener is run earlier) 'priority' => 500, @@ -262,12 +257,6 @@ listener in the Symfony application by creating a new service for it and The `AsDoctrineListener`_ attribute was introduced in DoctrineBundle 2.7.2. -.. tip:: - - Symfony loads (and instantiates) Doctrine listeners only when the related - Doctrine event is actually fired; whereas Doctrine subscribers are always - loaded (and instantiated) by Symfony, making them less performant. - .. tip:: The value of the ``connection`` option can also be a @@ -414,148 +403,6 @@ with the ``doctrine.orm.entity_listener`` tag as follows: ; }; -Doctrine Lifecycle Subscribers ------------------------------- - -Lifecycle subscribers are defined as PHP classes that implement the -``Doctrine\Common\EventSubscriber`` interface and which listen to one or more -Doctrine events on all the application entities. For example, suppose that you -want to log all the database activity. To do so, define a subscriber for the -``postPersist``, ``postRemove`` and ``postUpdate`` Doctrine events:: - - // src/EventListener/DatabaseActivitySubscriber.php - namespace App\EventListener; - - use App\Entity\Product; - use Doctrine\Bundle\DoctrineBundle\EventSubscriber\EventSubscriberInterface; - use Doctrine\ORM\Event\PostPersistEventArgs; - use Doctrine\ORM\Event\PostRemoveEventArgs; - use Doctrine\ORM\Event\PostUpdateEventArgs; - use Doctrine\ORM\Events; - - class DatabaseActivitySubscriber implements EventSubscriberInterface - { - // this method can only return the event names; you cannot define a - // custom method name to execute when each event triggers - public function getSubscribedEvents(): array - { - return [ - Events::postPersist, - Events::postRemove, - Events::postUpdate, - ]; - } - - // callback methods must be called exactly like the events they listen to; - // they receive an argument of type Post*EventArgs, which gives you access - // to both the entity object of the event and the entity manager itself - public function postPersist(PostPersistEventArgs $args): void - { - $this->logActivity('persist', $args->getObject()); - } - - public function postRemove(PostRemoveEventArgs $args): void - { - $this->logActivity('remove', $args->getObject()); - } - - public function postUpdate(PostUpdateEventArgs $args): void - { - $this->logActivity('update', $args->getObject()); - } - - private function logActivity(string $action, mixed $entity): void - { - // if this subscriber only applies to certain entity types, - // add some code to check the entity type as early as possible - if (!$entity instanceof Product) { - return; - } - - // ... get the entity information and log it somehow - } - } - -.. note:: - - In previous Doctrine versions, instead of ``Post*EventArgs`` classes, you had - to use ``LifecycleEventArgs``, which was deprecated in Doctrine ORM 2.14. - -If you're using the :ref:`default services.yaml configuration ` -and DoctrineBundle 2.1 (released May 25, 2020) or newer, this example will already -work! Otherwise, :ref:`create a service ` for this -subscriber and :doc:`tag it ` with ``doctrine.event_subscriber``. - -If you need to configure some option of the subscriber (e.g. its priority or -Doctrine connection to use) you must do that in the manual service configuration: - -.. configuration-block:: - - .. code-block:: yaml - - # config/services.yaml - services: - # ... - - App\EventListener\DatabaseActivitySubscriber: - tags: - - name: 'doctrine.event_subscriber' - - # subscribers can define their priority in case multiple subscribers or listeners are associated - # to the same event (default priority = 0; higher numbers = listener is run earlier) - priority: 500 - - # you can also restrict listeners to a specific Doctrine connection - connection: 'default' - - .. code-block:: xml - - - - - - - - - - - - - - - .. code-block:: php - - // config/services.php - namespace Symfony\Component\DependencyInjection\Loader\Configurator; - - use App\EventListener\DatabaseActivitySubscriber; - - return static function (ContainerConfigurator $container): void { - $services = $container->services(); - - $services->set(DatabaseActivitySubscriber::class) - ->tag('doctrine.event_subscriber'[ - // subscribers can define their priority in case multiple subscribers or listeners are associated - // to the same event (default priority = 0; higher numbers = listener is run earlier) - 'priority' => 500, - - // you can also restrict listeners to a specific Doctrine connection - 'connection' => 'default', - ]) - ; - }; - -.. tip:: - - Symfony loads (and instantiates) Doctrine subscribers whenever the - application executes; whereas Doctrine listeners are only loaded when the - related event is actually fired, making them more performant. - .. _`Doctrine`: https://www.doctrine-project.org/ .. _`lifecycle events`: https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/events.html#lifecycle-events .. _`official docs about Doctrine events`: https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/events.html diff --git a/mailer.rst b/mailer.rst index 8dc952f2fb9..22807ed3533 100644 --- a/mailer.rst +++ b/mailer.rst @@ -581,12 +581,6 @@ Alternatively you can attach contents from a stream by passing it directly to th ->addPart(new DataPart(fopen('/path/to/documents/contract.doc', 'r'))) ; -.. deprecated:: 6.2 - - In Symfony versions previous to 6.2, the methods ``attachFromPath()`` and - ``attach()`` could be used to add attachments. These methods have been - deprecated and replaced with ``addPart()``. - Embedding Images ~~~~~~~~~~~~~~~~ @@ -628,12 +622,6 @@ images inside the HTML contents:: The support of embedded images as HTML backgrounds was introduced in Symfony 6.1. -.. deprecated:: 6.2 - - In Symfony versions previous to 6.2, the methods ``embedFromPath()`` and - ``embed()`` could be used to embed images. These methods have been deprecated - and replaced with ``addPart()`` together with inline ``DataPart`` objects. - .. _mailer-configure-email-globally: Configuring Emails Globally @@ -1561,7 +1549,7 @@ Here's an example of making one available to download:: { $message = (new DraftEmail()) ->html($this->renderView(/* ... */)) - ->attach(/* ... */) + ->addPart(/* ... */) ; $response = new Response($message->toString()); diff --git a/messenger.rst b/messenger.rst index c30e05c8836..b6ea33e8094 100644 --- a/messenger.rst +++ b/messenger.rst @@ -889,12 +889,6 @@ properties in the ``reset()`` method. If you don't want to reset the container, add the ``--no-reset`` option when running the ``messenger:consume`` command. -.. deprecated:: 6.1 - - In Symfony versions previous to 6.1, the service container didn't reset - automatically between messages and you had to set the - ``framework.messenger.reset_on_message`` option to ``true``. - .. _messenger-retries-failures: Retries & Failures diff --git a/reference/attributes.rst b/reference/attributes.rst index 761099a7356..6d0c4efa9ba 100644 --- a/reference/attributes.rst +++ b/reference/attributes.rst @@ -5,11 +5,6 @@ Attributes are the successor of annotations since PHP 8. Attributes are native to the language and Symfony takes full advantage of them across the framework and its different components. -.. deprecated:: 6.4 - - Annotations across the framework are deprecated since Symfony 6.4, you must - only use attributes instead. - Doctrine Bridge ~~~~~~~~~~~~~~~ diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index b1f2139034a..e28c50978e1 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -270,13 +270,9 @@ you can control. The following configuration options exist for a mapping: ``type`` ........ -One of ``annotation`` (for PHP annotations; it's the default value), -``attribute`` (for PHP attributes), ``xml``, ``yml``, ``php`` or -``staticphp``. This specifies which type of metadata type your mapping uses. - -.. deprecated:: 6.4 - - Annotations are deprecated since Symfony 6.4, use attributes instead. +One of ``attribute`` (for PHP attributes; it's the default value), +``xml``, ``yml``, ``php`` or ``staticphp``. This specifies which +type of metadata type your mapping uses. See `Doctrine Metadata Drivers`_ for more information about this option. diff --git a/reference/formats/expression_language.rst b/reference/formats/expression_language.rst index f38c951e372..a561ed5ce6d 100644 --- a/reference/formats/expression_language.rst +++ b/reference/formats/expression_language.rst @@ -333,7 +333,7 @@ Array Operators * ``in`` (contain) * ``not in`` (does not contain) -For example:: +These operators are using strict comparison. For example:: class User { diff --git a/reference/forms/types/options/date_widget_description.rst.inc b/reference/forms/types/options/date_widget_description.rst.inc index 99573a2358a..956ad8c7148 100644 --- a/reference/forms/types/options/date_widget_description.rst.inc +++ b/reference/forms/types/options/date_widget_description.rst.inc @@ -10,8 +10,3 @@ following: * ``single_text``: renders a single input of type ``date``. User's input is validated based on the `format`_ option. - -.. deprecated:: 6.3 - - Not setting a value explicitly for this option is deprecated since Symfony 6.3 - because the default value will change to ``single_text`` in Symfony 7.0. diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst index 0ee272f0325..58e6ef2d075 100644 --- a/serializer/custom_normalizer.rst +++ b/serializer/custom_normalizer.rst @@ -58,15 +58,6 @@ normalization process:: } } -.. deprecated:: 6.4 - - Injecting an ``ObjectNormalizer`` in your custom normalizer is deprecated - since Symfony 6.4. Implement the - :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerAwareInterface` - and use the - :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerAwareTrait` instead - to inject the ``$normalizer`` property. - Registering it in your Application ---------------------------------- diff --git a/service_container/service_decoration.rst b/service_container/service_decoration.rst index 8a9ac1322f2..0262ae03e7e 100644 --- a/service_container/service_decoration.rst +++ b/service_container/service_decoration.rst @@ -211,12 +211,6 @@ automatically changed to ``'.inner'``): ->args([service('.inner')]); }; -.. deprecated:: 6.3 - - The ``#[MapDecorated]`` attribute is deprecated since Symfony 6.3. - Instead, use the - :class:`#[AutowireDecorated] ` attribute. - .. tip:: The visibility of the decorated ``App\Mailer`` service (which is an alias From bae960241c7f044659e3c503b79d63f85e8b960b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 17 Aug 2023 12:47:16 +0200 Subject: [PATCH 29/99] clean up more legacy annotation config --- components/validator/resources.rst | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/components/validator/resources.rst b/components/validator/resources.rst index 19b0c54b6ec..1b512942325 100644 --- a/components/validator/resources.rst +++ b/components/validator/resources.rst @@ -88,30 +88,24 @@ The AnnotationLoader At last, the component provides an :class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AnnotationLoader` to get -the metadata from the annotations of the class. Annotations are defined as ``@`` -prefixed classes included in doc block comments (``/** ... */``). For example:: +the metadata from the attributes of the class:: use Symfony\Component\Validator\Constraints as Assert; // ... class User { - /** - * @Assert\NotBlank - */ + #[Assert\NotBlank] protected string $name; } To enable the annotation loader, call the -:method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAnnotationMapping` method. -If you use annotations instead of attributes, it's also required to call -``addDefaultDoctrineAnnotationReader()`` to use Doctrine's annotation reader:: +:method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAnnotationMapping` method:: use Symfony\Component\Validator\Validation; $validator = Validation::createValidatorBuilder() ->enableAnnotationMapping() - ->addDefaultDoctrineAnnotationReader() // add this only when using annotations ->getValidator(); To disable the annotation loader after it was enabled, call @@ -133,7 +127,6 @@ multiple mappings:: $validator = Validation::createValidatorBuilder() ->enableAnnotationMapping(true) - ->addDefaultDoctrineAnnotationReader() ->addMethodMapping('loadValidatorMetadata') ->addXmlMapping('validator/validation.xml') ->getValidator(); From 4fbda5d91644e72c2e164b1eaeea6028e0b10765 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 5 Sep 2023 11:11:29 +0200 Subject: [PATCH 30/99] [Workflow] Remove `GuardEvent::getContext()` method without replacement --- workflow.rst | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/workflow.rst b/workflow.rst index 88021884130..2e17b40794c 100644 --- a/workflow.rst +++ b/workflow.rst @@ -463,21 +463,6 @@ order: $workflow->apply($subject, $transitionName, [Workflow::DISABLE_ANNOUNCE_EVENT => true]); -The context is accessible in all events except for the ``workflow.guard`` events:: - - // $context must be an array - $context = ['context_key' => 'context_value']; - $workflow->apply($subject, $transitionName, $context); - - // in an event listener (workflow.guard events) - $context = $event->getContext(); // returns ['context'] - -.. deprecated:: 6.4 - - Gathering events context is deprecated since Symfony 6.4 and the - :method:`Symfony\\Component\\Workflow\\Event::getContext` method will be - removed in Symfony 7.0. - .. note:: The leaving and entering events are triggered even for transitions that stay From d7717fb4ea37ee57c3f4b5b56051c5fa82fb830f Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 5 Sep 2023 11:15:20 +0200 Subject: [PATCH 31/99] Remove mentions of AnnotationLoader --- _includes/_annotation_loader_tip.rst.inc | 19 ---------- components/validator/resources.rst | 46 ------------------------ reference/configuration/framework.rst | 24 ------------- 3 files changed, 89 deletions(-) delete mode 100644 _includes/_annotation_loader_tip.rst.inc diff --git a/_includes/_annotation_loader_tip.rst.inc b/_includes/_annotation_loader_tip.rst.inc deleted file mode 100644 index 0f4267b07f5..00000000000 --- a/_includes/_annotation_loader_tip.rst.inc +++ /dev/null @@ -1,19 +0,0 @@ -.. note:: - - In order to use the annotation loader, you should have installed the - ``doctrine/annotations`` and ``doctrine/cache`` packages with Composer. - -.. tip:: - - Annotation classes aren't loaded automatically, so you must load them - using a class loader like this:: - - use Composer\Autoload\ClassLoader; - use Doctrine\Common\Annotations\AnnotationRegistry; - - /** @var ClassLoader $loader */ - $loader = require __DIR__.'/../vendor/autoload.php'; - - AnnotationRegistry::registerLoader([$loader, 'loadClass']); - - return $loader; diff --git a/components/validator/resources.rst b/components/validator/resources.rst index dd218a26a12..d9d3543a641 100644 --- a/components/validator/resources.rst +++ b/components/validator/resources.rst @@ -83,52 +83,6 @@ configure the locations of these files:: :method:`Symfony\\Component\\Validator\\ValidatorBuilder::addXmlMappings` to configure an array of file paths. -The AnnotationLoader --------------------- - -.. deprecated:: 6.4 - - The :class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AnnotationLoader` - is deprecated since Symfony 6.4, use the - :class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AttributeLoader` - instead. - -The component provides an -:class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AnnotationLoader` to get -the metadata from the attributes of the class:: - - use Symfony\Component\Validator\Constraints as Assert; - // ... - - class User - { - #[Assert\NotBlank] - protected string $name; - } - -To enable the annotation loader, call the -:method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAnnotationMapping` method:: - - use Symfony\Component\Validator\Validation; - - $validator = Validation::createValidatorBuilder() - ->enableAnnotationMapping() - ->getValidator(); - -To disable the annotation loader after it was enabled, call -:method:`Symfony\\Component\\Validator\\ValidatorBuilder::disableAnnotationMapping`. - -.. deprecated:: 6.4 - - The :method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAnnotationMapping` - and :method:`Symfony\\Component\\Validator\\ValidatorBuilder::disableAnnotationMapping` - methods are deprecated since Symfony 6.4, use the - :method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAttributeMapping` - and :method:`Symfony\\Component\\Validator\\ValidatorBuilder::disableAttributeMapping` - methods instead. - -.. include:: /_includes/_annotation_loader_tip.rst.inc - The AttributeLoader ------------------- diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index efa028b0824..a498328e9fe 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -2701,18 +2701,6 @@ settings is configured. .. _reference-validation-enable_annotations: -enable_annotations -.................. - -**type**: ``boolean`` **default**: ``true`` - -If this option is enabled, validation constraints can be defined using annotations or `PHP attributes`_. - -.. deprecated:: 6.4 - - This option is deprecated since Symfony 6.4, use the ``enable_attributes`` - option instead. - enable_attributes ................. @@ -2899,18 +2887,6 @@ Whether to enable the ``serializer`` service or not in the service container. .. _reference-serializer-enable_annotations: -enable_annotations -.................. - -**type**: ``boolean`` **default**: ``true`` - -If this option is enabled, serialization groups can be defined using annotations or attributes. - -.. deprecated:: 6.4 - - This option is deprecated since Symfony 6.4, use the ``enable_attributes`` - option instead. - enable_attributes ................. From 73121fbd0e59644259c1d50dd3c59aeab4cdbb47 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 5 Sep 2023 13:30:58 +0200 Subject: [PATCH 32/99] Remove a versionadded directive --- routing.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/routing.rst b/routing.rst index 11aea4039b3..6a6d2095e23 100644 --- a/routing.rst +++ b/routing.rst @@ -2258,11 +2258,6 @@ that defines only one route. Consider the following class:: Symfony will add a route alias named ``App\Controller\MainController::homepage``. -.. versionadded:: 6.4 - - The automatic declaration of route aliases based on FQCNs was introduced in - Symfony 6.4. - Generating URLs in Controllers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 79da0629e6ea7fdb1b747e3b55da4f1f10a6a50e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 22 Sep 2023 11:02:26 +0200 Subject: [PATCH 33/99] Remove a versionadded directive --- console.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/console.rst b/console.rst index 86f05625dd6..2aafad3f602 100644 --- a/console.rst +++ b/console.rst @@ -582,11 +582,6 @@ even the color mode being used. You have access to such information thanks to th // changes the color mode $colorMode = $terminal->setColorMode(AnsiColorMode::Ansi24); -.. versionadded:: 6.2 - - The support for setting and getting the current color mode was introduced - in Symfony 6.2. - Logging Command Errors ---------------------- From b2c73abc2cdcac9030f4fd9d0582f9649bbd5cb2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 4 Oct 2023 09:10:49 +0200 Subject: [PATCH 34/99] Remove an unneeded versionadded directive --- routing.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/routing.rst b/routing.rst index e109170e294..fb5931cc517 100644 --- a/routing.rst +++ b/routing.rst @@ -2724,12 +2724,6 @@ service, which you can inject in your services or controllers:: } } -.. versionadded:: 6.4 - - The namespace of the ``UriSigner`` class changed in Symfony 6.4 from - ``Symfony\Component\HttpKernel\UriSigner`` to - ``Symfony\Component\HttpFoundation\UriSigner``. - Troubleshooting --------------- From a45366817bd43f44b7bd9e6e45d41921df943731 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 4 Oct 2023 13:38:47 +0200 Subject: [PATCH 35/99] [RateLimiter] Remove deprecations --- rate_limiter.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/rate_limiter.rst b/rate_limiter.rst index 06c888b480b..1fe86ef020a 100644 --- a/rate_limiter.rst +++ b/rate_limiter.rst @@ -375,14 +375,6 @@ the :class:`Symfony\\Component\\RateLimiter\\Reservation` object returned by the The :method:`Symfony\\Component\\RateLimiter\\Policy\\SlidingWindow::calculateTimeForTokens` method was introduced in Symfony 6.4. -.. deprecated:: 6.4 - - The :method:`Symfony\\Component\\RateLimiter\\Policy\\SlidingWindow::getRetryAfter` - method is deprecated since Symfony 6.4. Prior to this version, the - ``getRetryAfter()`` method must be used instead of the - :method:`Symfony\\Component\\RateLimiter\\Policy\\SlidingWindow::calculateTimeForTokens` - method. - .. _rate-limiter-storage: Storing Rate Limiter State From 83162e3f96cc997d31b7e695d0e2143b33af232f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 6 Oct 2023 16:18:57 +0200 Subject: [PATCH 36/99] Remove an unneeded reference to a not recommended feature --- security.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/security.rst b/security.rst index 301371bede9..7285a6b77b4 100644 --- a/security.rst +++ b/security.rst @@ -2678,15 +2678,6 @@ like this: :doc:`impersonating ` another user in this session, this attribute will match. -.. note:: - - All logged in users also have an attribute called ``IS_AUTHENTICATED_REMEMBERED``, - even if the application doesn't use the Remember Me feature. This attribute - exists for backward-compatibility reasons with Symfony versions prior to 6.4. - - This attribute behaves the same as ``IS_AUTHENTICATED``. That's why in modern - Symfony applications it's recommended to no longer use ``IS_AUTHENTICATED_REMEMBERED``. - .. _user_session_refresh: Understanding how Users are Refreshed from the Session From bbd1d8e092c672be67ea75f3f346cd126c5a9de4 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 16 Oct 2023 10:47:57 +0200 Subject: [PATCH 37/99] Remove all 6.x `versionadded` on 7.0 --- .doctor-rst.yaml | 8 +- bundles.rst | 5 -- bundles/configuration.rst | 4 - bundles/extension.rst | 4 - bundles/prepend_extension.rst | 4 - cache.rst | 12 --- components/browser_kit.rst | 8 -- components/cache/adapters/redis_adapter.rst | 8 -- components/clock.rst | 32 ------- components/config/definition.rst | 5 -- components/console/events.rst | 15 ---- .../console/helpers/formatterhelper.rst | 4 - components/console/helpers/progressbar.rst | 8 -- components/console/helpers/table.rst | 4 - components/css_selector.rst | 4 - .../dependency_injection/compilation.rst | 4 - components/dom_crawler.rst | 14 --- components/expression_language.rst | 4 - components/finder.rst | 5 -- components/http_foundation.rst | 34 +------ components/http_kernel.rst | 11 --- components/intl.rst | 12 --- components/lock.rst | 9 -- components/options_resolver.rst | 4 - components/phpunit_bridge.rst | 16 ---- components/process.rst | 4 - components/property_access.rst | 9 -- components/property_info.rst | 6 -- components/serializer.rst | 26 ------ components/string.rst | 8 -- components/uid.rst | 20 ----- components/validator/resources.rst | 5 -- components/var_dumper.rst | 4 - components/var_exporter.rst | 13 --- components/yaml.rst | 8 -- configuration.rst | 20 ----- configuration/env_var_processors.rst | 12 --- configuration/micro_kernel_trait.rst | 8 -- console.rst | 12 --- console/coloring.rst | 4 - console/input.rst | 6 -- console/style.rst | 8 -- contributing/documentation/format.rst | 20 ++--- controller.rst | 32 ------- controller/value_resolver.rst | 42 --------- doctrine.rst | 9 -- form/unit_testing.rst | 5 -- frontend/asset_mapper.rst | 21 ----- html_sanitizer.rst | 4 - http_cache.rst | 4 - http_cache/esi.rst | 4 - http_client.rst | 46 ---------- lock.rst | 5 -- mailer.rst | 79 ----------------- messenger.rst | 88 ------------------- notifier.rst | 57 ------------ performance.rst | 4 - profiler.rst | 8 -- rate_limiter.rst | 10 --- reference/configuration/debug.rst | 4 - reference/configuration/framework.rst | 48 ---------- reference/configuration/kernel.rst | 5 -- reference/configuration/security.rst | 16 ---- reference/configuration/twig.rst | 13 --- reference/constraints/Cascade.rst | 4 - reference/constraints/Choice.rst | 4 - reference/constraints/Email.rst | 4 - reference/constraints/Expression.rst | 12 --- reference/constraints/File.rst | 16 ---- reference/constraints/Length.rst | 16 ---- .../constraints/NoSuspiciousCharacters.rst | 4 - reference/constraints/PasswordStrength.rst | 4 - reference/constraints/Regex.rst | 4 - reference/constraints/Time.rst | 4 - reference/constraints/Type.rst | 4 - reference/constraints/Unique.rst | 4 - reference/constraints/UniqueEntity.rst | 5 -- reference/constraints/Uuid.rst | 9 -- reference/constraints/When.rst | 8 -- reference/dic_tags.rst | 7 -- reference/formats/expression_language.rst | 18 ---- reference/formats/yaml.rst | 4 - reference/forms/types/collection.rst | 4 - reference/forms/types/enum.rst | 4 - reference/forms/types/number.rst | 4 - .../forms/types/options/choice_label.rst.inc | 6 -- .../duplicate_preferred_choices.rst.inc | 4 - reference/forms/types/options/help.rst.inc | 5 -- .../types/options/placeholder_attr.rst.inc | 4 - .../forms/types/options/sanitize_html.rst.inc | 4 - .../forms/types/options/sanitizer.rst.inc | 4 - reference/forms/types/password.rst | 4 - reference/twig_reference.rst | 12 --- routing.rst | 38 -------- routing/custom_route_loader.rst | 9 -- security.rst | 60 ------------- security/access_control.rst | 8 -- security/access_token.rst | 8 -- security/expressions.rst | 4 - security/impersonating_user.rst | 4 - security/login_link.rst | 4 - security/remember_me.rst | 4 - security/user_checkers.rst | 4 - security/voters.rst | 4 - serializer.rst | 26 ------ serializer/custom_context_builders.rst | 4 - service_container.rst | 14 --- service_container/alias_private.rst | 4 - service_container/autowiring.rst | 18 ---- service_container/debug.rst | 6 +- service_container/expression_language.rst | 8 -- service_container/factories.rst | 8 -- service_container/lazy_services.rst | 10 --- service_container/service_decoration.rst | 4 - .../service_subscribers_locators.rst | 20 ----- service_container/tags.rst | 13 --- templates.rst | 28 ------ testing.rst | 38 -------- translation.rst | 29 ------ validation.rst | 4 - validation/custom_constraint.rst | 4 - workflow.rst | 24 ----- workflow/workflow-and-state-machine.rst | 4 - 123 files changed, 18 insertions(+), 1516 deletions(-) diff --git a/.doctor-rst.yaml b/.doctor-rst.yaml index ee1713d3100..f309ce1d49d 100644 --- a/.doctor-rst.yaml +++ b/.doctor-rst.yaml @@ -68,16 +68,16 @@ rules: # master versionadded_directive_major_version: - major_version: 6 + major_version: 7 versionadded_directive_min_version: - min_version: '6.0' + min_version: '7.0' deprecated_directive_major_version: - major_version: 6 + major_version: 7 deprecated_directive_min_version: - min_version: '6.0' + min_version: '7.0' exclude_rule_for_file: - path: configuration/multiple_kernels.rst diff --git a/bundles.rst b/bundles.rst index 19dd8c31aa8..50ffc39d156 100644 --- a/bundles.rst +++ b/bundles.rst @@ -56,11 +56,6 @@ Start by creating a new class called ``AcmeTestBundle``:: { } -.. versionadded:: 6.1 - - The :class:`Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle` was - introduced in Symfony 6.1. - .. caution:: If your bundle must be compatible with previous Symfony versions you have to diff --git a/bundles/configuration.rst b/bundles/configuration.rst index 4a2224429ed..a6a21023de6 100644 --- a/bundles/configuration.rst +++ b/bundles/configuration.rst @@ -320,10 +320,6 @@ In your extension, you can load this and dynamically set its arguments:: Using the AbstractBundle Class ------------------------------ -.. versionadded:: 6.1 - - The ``AbstractBundle`` class was introduced in Symfony 6.1. - As an alternative, instead of creating an extension and configuration class as shown in the previous section, you can also extend :class:`Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle` to add this diff --git a/bundles/extension.rst b/bundles/extension.rst index ff873f2ab14..3c660251403 100644 --- a/bundles/extension.rst +++ b/bundles/extension.rst @@ -111,10 +111,6 @@ To read more about it, see the ":doc:`/bundles/configuration`" article. Loading Services directly in your Bundle class ---------------------------------------------- -.. versionadded:: 6.1 - - The ``AbstractBundle`` class was introduced in Symfony 6.1. - Alternatively, you can define and load services configuration directly in a bundle class instead of creating a specific ``Extension`` class. You can do this by extending from :class:`Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle` diff --git a/bundles/prepend_extension.rst b/bundles/prepend_extension.rst index fcad249124e..bed3d06da43 100644 --- a/bundles/prepend_extension.rst +++ b/bundles/prepend_extension.rst @@ -154,10 +154,6 @@ registered and the ``entity_manager_name`` setting for ``acme_hello`` is set to Prepending Extension in the Bundle Class ---------------------------------------- -.. versionadded:: 6.1 - - The ``AbstractBundle`` class was introduced in Symfony 6.1. - You can also append or prepend extension configuration directly in your Bundle class if you extend from the :class:`Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle` class and define the :method:`Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle::prependExtension` diff --git a/cache.rst b/cache.rst index 7bf72bf2608..3d247c4a1bb 100644 --- a/cache.rst +++ b/cache.rst @@ -745,20 +745,12 @@ Clear all cache pools: $ php bin/console cache:pool:clear --all -.. versionadded:: 6.3 - - The ``--all`` option was introduced in Symfony 6.3. - Clear all cache pools except some: .. code-block:: terminal $ php bin/console cache:pool:clear --all --exclude=my_cache_pool --exclude=another_cache_pool -.. versionadded:: 6.4 - - The ``--exclude`` option was introduced in Symfony 6.4. - Clear all caches everywhere: .. code-block:: terminal @@ -767,10 +759,6 @@ Clear all caches everywhere: Clear cache by tag(s): -.. versionadded:: 6.1 - - The ``cache:pool:invalidate-tags`` command was introduced in Symfony 6.1. - .. code-block:: terminal # invalidate tag1 from all taggable pools diff --git a/components/browser_kit.rst b/components/browser_kit.rst index c744837d7b1..bcb8f7b3c8e 100644 --- a/components/browser_kit.rst +++ b/components/browser_kit.rst @@ -130,10 +130,6 @@ on a link:: // ... and `clickLink()` $crawler = $client->clickLink('Go elsewhere...', ['X-Custom-Header' => 'Some data']); -.. versionadded:: 6.4 - - The ``serverParameters`` parameter was introduced in Symfony 6.4. - Submitting Forms ~~~~~~~~~~~~~~~~ @@ -403,10 +399,6 @@ to call ``json_decode()`` explicitly:: $response = $browser->getResponse()->toArray(); // $response is a PHP array of the decoded JSON contents -.. versionadded:: 6.1 - - The ``toArray()`` method was introduced in Symfony 6.1. - Learn more ---------- diff --git a/components/cache/adapters/redis_adapter.rst b/components/cache/adapters/redis_adapter.rst index 02523dd283e..a25b1a510ed 100644 --- a/components/cache/adapters/redis_adapter.rst +++ b/components/cache/adapters/redis_adapter.rst @@ -41,10 +41,6 @@ as the second and third parameters:: $defaultLifetime = 0 ); -.. versionadded:: 6.3 - - Support for `Relay`_ was introduced in Symfony 6.3. - Configure the Connection ------------------------ @@ -163,10 +159,6 @@ array of ``key => value`` pairs representing option names and their respective v Available Options ~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.3 - - ``\Relay\Relay`` support was introduced in Symfony 6.3. - ``class`` (type: ``string``, default: ``null``) Specifies the connection library to return, either ``\Redis``, ``\Relay\Relay`` or ``\Predis\Client``. If none is specified, fallback value is in following order, depending which one is available first: diff --git a/components/clock.rst b/components/clock.rst index f58124c70af..b803c78e29d 100644 --- a/components/clock.rst +++ b/components/clock.rst @@ -1,10 +1,6 @@ The Clock Component =================== -.. versionadded:: 6.2 - - The Clock component was introduced in Symfony 6.2 - The Clock component decouples applications from the system clock. This allows you to fix time to improve testability of time-sensitive logic. @@ -79,16 +75,6 @@ When using the Clock component, you manipulate :class:`Symfony\\Component\\Clock\\DatePoint` instances. You can learn more about it in :ref:`the dedicated section `. -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\Clock\\Clock` class and ``now()`` function - were introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The ``modifier`` argument of the ``now()`` function was introduced in - Symfony 6.4. - Available Clocks Implementations -------------------------------- @@ -208,10 +194,6 @@ you can set the current time arbitrarily without having to change your service c This will help you test every case of your method without the need of actually being in a month or another. -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\Clock\\ClockAwareTrait` was introduced in Symfony 6.3. - .. _clock_date-point: The ``DatePoint`` Class @@ -253,11 +235,6 @@ The constructor also allows setting a timezone or custom referenced date:: error handling across versions of PHP, thanks to polyfilling `PHP 8.3's behavior`_ on the topic. -.. versionadded:: 6.4 - - The :class:`Symfony\\Component\\Clock\\DatePoint` class was introduced - in Symfony 6.4. - .. _clock_writing-tests: Writing Time-Sensitive Tests @@ -314,10 +291,6 @@ By combining the :class:`Symfony\\Component\\Clock\\ClockAwareTrait` and :class:`Symfony\\Component\\Clock\\Test\\ClockSensitiveTrait`, you have full control on your time-sensitive code's behavior. -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\Clock\\Test\\ClockSensitiveTrait` was introduced in Symfony 6.3. - Exceptions Management --------------------- @@ -338,11 +311,6 @@ These exceptions are available starting from PHP 8.3. However, thanks to the `symfony/polyfill-php83`_ dependency required by the Clock component, you can use them even if your project doesn't use PHP 8.3 yet. -.. versionadded:: 6.4 - - The support for ``DateMalformedStringException`` and - ``DateInvalidTimeZoneException`` was introduced in Symfony 6.4. - .. _`PSR-20`: https://www.php-fig.org/psr/psr-20/ .. _`accepted by the DateTime constructor`: https://www.php.net/manual/en/datetime.formats.php .. _`PHP DateTime exceptions`: https://wiki.php.net/rfc/datetime-exceptions diff --git a/components/config/definition.rst b/components/config/definition.rst index 9c90304c578..63ebcd7cc72 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -171,11 +171,6 @@ The configuration can now be written like this:: ->end() ; -.. versionadded:: 6.3 - - The support of enum values in ``enumNode()`` was introduced - in Symfony 6.3. - Array Nodes ~~~~~~~~~~~ diff --git a/components/console/events.rst b/components/console/events.rst index 6356816a9b2..1476a83f37d 100644 --- a/components/console/events.rst +++ b/components/console/events.rst @@ -156,11 +156,6 @@ Listeners receive a a signal. You can learn more about signals in the :ref:`the dedicated section `. - .. versionadded:: 6.4 - - Dispatching the ``ConsoleEvents::TERMINATE`` event on exit - signal was introduced in Symfony 6.4. - .. _console-events_signal: The ``ConsoleEvents::SIGNAL`` Event @@ -207,11 +202,6 @@ method:: $event->abortExit(); }); -.. versionadded:: 6.3 - - The ``setExitCode()``, ``getExitCode()`` and ``abortExit()`` methods were introduced - in Symfony 6.3. - .. tip:: All the available signals (``SIGINT``, ``SIGQUIT``, etc.) are defined as @@ -262,11 +252,6 @@ handle all signals e.g. to do some tasks before terminating the command. :method:`Symfony\\Component\\Console\\SignalRegistry\\SignalMap::getSignalName` method. - .. versionadded:: 6.4 - - The :class:`Symfony\\Component\\Console\\SignalRegistry\\SignalMap` class was - introduced in Symfony 6.4. - .. _`reserved exit codes`: https://www.tldp.org/LDP/abs/html/exitcodes.html .. _`Signals`: https://en.wikipedia.org/wiki/Signal_(IPC) .. _`constants of the PCNTL PHP extension`: https://www.php.net/manual/en/pcntl.constants.php diff --git a/components/console/helpers/formatterhelper.rst b/components/console/helpers/formatterhelper.rst index 061b7616c8d..3beb4204622 100644 --- a/components/console/helpers/formatterhelper.rst +++ b/components/console/helpers/formatterhelper.rst @@ -132,7 +132,3 @@ precision (default ``1``) of the result:: $formatter->truncate(125); // 2 mins $formatter->truncate(125, 2); // 2 mins, 5 secs $formatter->truncate(172799, 4); // 1 day, 23 hrs, 59 mins, 59 secs - -.. versionadded:: 6.4 - - The support for exact times were introduced in Symfony 6.4. diff --git a/components/console/helpers/progressbar.rst b/components/console/helpers/progressbar.rst index 58f1fba37ff..a501d39fa14 100644 --- a/components/console/helpers/progressbar.rst +++ b/components/console/helpers/progressbar.rst @@ -69,10 +69,6 @@ that starting point:: // displays the progress bar starting at 25 completed units $progressBar->start(null, 25); -.. versionadded:: 6.2 - - The option to start a progress bar at a certain point was introduced in Symfony 6.2. - .. tip:: If your platform doesn't support ANSI codes, updates to the progress @@ -375,10 +371,6 @@ with the ``setPlaceholderFormatter`` method:: return $progressBar->getMaxSteps() - $progressBar->getProgress(); }); -.. versionadded:: 6.3 - - The ``setPlaceholderFormatter()`` method was introduced in Symfony 6.3. - Custom Messages ~~~~~~~~~~~~~~~ diff --git a/components/console/helpers/table.rst b/components/console/helpers/table.rst index fcc52e0e7a4..6d86cbc6130 100644 --- a/components/console/helpers/table.rst +++ b/components/console/helpers/table.rst @@ -175,10 +175,6 @@ The output of this command will be: | Author: Charles Dickens | +------------------------------+ -.. versionadded:: 6.1 - - Support for vertical rendering was introduced in Symfony 6.1. - The table style can be changed to any built-in styles via :method:`Symfony\\Component\\Console\\Helper\\Table::setStyle`:: diff --git a/components/css_selector.rst b/components/css_selector.rst index 94561cec9bd..c09f80a3cf4 100644 --- a/components/css_selector.rst +++ b/components/css_selector.rst @@ -94,10 +94,6 @@ Pseudo-classes are partially supported: ``li:first-of-type``) but not with the ``*`` selector). * Supported: ``*:only-of-type``, ``*:scope``. -.. versionadded:: 6.3 - - The support for ``*:scope`` was introduced in Symfony 6.3. - Learn more ---------- diff --git a/components/dependency_injection/compilation.rst b/components/dependency_injection/compilation.rst index 8fe7b0242e5..3787c686982 100644 --- a/components/dependency_injection/compilation.rst +++ b/components/dependency_injection/compilation.rst @@ -278,10 +278,6 @@ The parameter being deprecated must be set before being declared as deprecated. Otherwise a :class:`Symfony\\Component\\DependencyInjection\\Exception\\ParameterNotFoundException` exception will be thrown. -.. versionadded:: 6.3 - - The ``ContainerBuilder::deprecateParameter()`` method was introduced in Symfony 6.3. - .. note:: Just registering an extension with the container is not enough to get diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 4440a35f0ea..ac859efac91 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -229,11 +229,6 @@ Access the value of the first node of the current selection:: // but you can get the unchanged text by passing FALSE as argument $text = $crawler->filterXPath('//body/p')->innerText(false); -.. versionadded:: 6.3 - - The removal of whitespace characters by default in ``innerText()`` was - introduced in Symfony 6.3. - Access the attribute value of the first node of the current selection:: $class = $crawler->filterXPath('//body/p')->attr('class'); @@ -245,11 +240,6 @@ Access the attribute value of the first node of the current selection:: $class = $crawler->filterXPath('//body/p')->attr('class', 'my-default-class'); - .. versionadded:: 6.4 - - The possibility to specify a default value to the ``attr()`` method - was introduced in Symfony 6.4. - Extract attribute and/or node values from the list of nodes:: $attributes = $crawler @@ -672,10 +662,6 @@ parser, set its ``useHtml5Parser`` constructor argument to ``true``:: By doing so, the crawler will use the HTML5 parser provided by the `masterminds/html5`_ library to parse the documents. -.. versionadded:: 6.3 - - The ``useHtml5Parser`` argument was introduced in Symfony 6.3. - Learn more ---------- diff --git a/components/expression_language.rst b/components/expression_language.rst index a08e77b01ea..a10ad6cfe1b 100644 --- a/components/expression_language.rst +++ b/components/expression_language.rst @@ -92,10 +92,6 @@ can chain multiple coalescing operators. * ``foo[3] ?? 'no'`` * ``foo.baz ?? foo['baz'] ?? 'no'`` -.. versionadded:: 6.2 - - The null-coalescing operator was introduced in Symfony 6.2. - Passing in Variables -------------------- diff --git a/components/finder.rst b/components/finder.rst index 27dd6709b6d..ecf19fc1fe1 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -340,11 +340,6 @@ Sort the results by name, extension, size or type (directories first, then files $finder->sortBySize(); $finder->sortByType(); -.. versionadded:: 6.2 - - The ``sortByCaseInsensitiveName()``, ``sortByExtension()`` and ``sortBySize()`` - methods were introduced in Symfony 6.2. - .. tip:: By default, the ``sortByName()`` method uses the :phpfunction:`strcmp` PHP diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 18d64d6b467..5c6d0dba0c7 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -145,11 +145,6 @@ has some methods to filter the input values: :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getString` Returns the parameter value as a string; -.. versionadded:: 6.3 - - The ``ParameterBag::getEnum()`` and ``ParameterBag::getString()`` methods - were introduced in Symfony 6.3. - :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::filter` Filters the parameter by using the PHP :phpfunction:`filter_var` function. If invalid values are found, a @@ -220,11 +215,6 @@ wrapping this data:: $data = $request->getPayload(); -.. versionadded:: 6.3 - - The :method:`Symfony\\Component\\HttpFoundation\\Request::getPayload` - method was introduced in Symfony 6.3. - Identifying a Request ~~~~~~~~~~~~~~~~~~~~~ @@ -389,10 +379,6 @@ use the ``isPrivateIp()`` method from the $isPrivate = IpUtils::isPrivateIp($ipv6); // $isPrivate = false -.. versionadded:: 6.3 - - The ``isPrivateIp()`` method was introduced in Symfony 6.3. - Accessing other Data ~~~~~~~~~~~~~~~~~~~~ @@ -562,11 +548,6 @@ call:: 'etag' => 'abcdef', ]); -.. versionadded:: 6.1 - - The ``stale_if_error`` and ``stale_while_revalidate`` options were - introduced in Symfony 6.1. - To check if the Response validators (``ETag``, ``Last-Modified``) match a conditional value specified in the client Request, use the :method:`Symfony\\Component\\HttpFoundation\\Response::isNotModified` @@ -629,11 +610,6 @@ represented by a PHP callable instead of a string:: Streaming a JSON Response ~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\HttpFoundation\\StreamedJsonResponse` class was - introduced in Symfony 6.3. - The :class:`Symfony\\Component\\HttpFoundation\\StreamedJsonResponse` allows to stream large JSON responses using PHP generators to keep the used resources low. @@ -646,9 +622,9 @@ containing JSON serializable data:: // any method or function returning a PHP Generator function loadArticles(): \Generator { - yield ['title' => 'Article 1']; - yield ['title' => 'Article 2']; - yield ['title' => 'Article 3']; + yield ['title' => 'Article 1']; + yield ['title' => 'Article 2']; + yield ['title' => 'Article 3']; }; $response = new StreamedJsonResponse( @@ -723,10 +699,6 @@ including generators:: return new StreamedJsonResponse(loadArticles()); } -.. versionadded:: 6.4 - - The ``StreamedJsonResponse`` support of iterables was introduced in Symfony 6.4. - .. _component-http-foundation-serving-files: Serving Files diff --git a/components/http_kernel.rst b/components/http_kernel.rst index 32f66f9ac2a..435ded9063a 100644 --- a/components/http_kernel.rst +++ b/components/http_kernel.rst @@ -280,10 +280,6 @@ Another typical use-case for this event is to retrieve the attributes from the controller using the :method:`Symfony\\Component\\HttpKernel\\Event\\ControllerEvent::getAttributes` method. See the Symfony section below for some examples. -.. versionadded:: 6.2 - - The ``ControllerEvent::getAttributes()`` method was introduced in Symfony 6.2. - Listeners to this event can also change the controller callable completely by calling :method:`ControllerEvent::setController ` on the event object that's passed to listeners on this event. @@ -343,13 +339,6 @@ of arguments that should be passed when executing that callable. ``ValueResolverInterface`` yourself and passing this to the ``ArgumentResolver``, you can extend this functionality. - .. versionadded:: 6.2 - - The ``ValueResolverInterface`` was introduced in Symfony 6.2. Prior to - 6.2, you had to use the - :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentValueResolverInterface`, - which defines different methods. - .. _component-http-kernel-calling-controller: 5) Calling the Controller diff --git a/components/intl.rst b/components/intl.rst index 3981062f5b7..46146e47e1b 100644 --- a/components/intl.rst +++ b/components/intl.rst @@ -210,10 +210,6 @@ numeric country codes:: $exists = Countries::numericCodeExists('250'); // => true -.. versionadded:: 6.4 - - The support for numeric country codes was introduced in Symfony 6.4. - Locales ~~~~~~~ @@ -397,10 +393,6 @@ to catching the exception, you can also check if a given timezone ID is valid:: Emoji Transliteration ~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.2 - - The Emoji transliteration feature was introduced in Symfony 6.2. - The ``EmojiTransliterator`` class provides a utility to translate emojis into their textual representation in all languages based on the `Unicode CLDR dataset`_:: @@ -448,10 +440,6 @@ Symfony emoji data files using the PHP ``zlib`` extension: # adjust the path to the 'compress' binary based on your application installation $ php ./vendor/symfony/intl/Resources/bin/compress -.. versionadded:: 6.3 - - The ``compress`` binary was introduced in Symfony 6.3. - Learn more ---------- diff --git a/components/lock.rst b/components/lock.rst index 1c87942bb34..9e854ab89a6 100644 --- a/components/lock.rst +++ b/components/lock.rst @@ -553,11 +553,6 @@ the command: $ php bin/console make:migration -.. versionadded:: 6.3 - - The automatic table generation when running the ``make:migration`` command - was introduced in Symfony 6.3. - If you prefer to create the table yourself and it has not already been created, you can create this table explicitly by calling the :method:`Symfony\\Component\\Lock\\Store\\DoctrineDbalStore::createTable` method. @@ -610,10 +605,6 @@ store locks and does not expire. RedisStore ~~~~~~~~~~ -.. versionadded:: 6.3 - - ``\Relay\Relay`` support was introduced in Symfony 6.3. - The RedisStore saves locks on a Redis server, it requires a Redis connection implementing the ``\Redis``, ``\RedisArray``, ``\RedisCluster``, ``\Relay\Relay`` or ``\Predis`` classes. This store does not support blocking, and expects a TTL to diff --git a/components/options_resolver.rst b/components/options_resolver.rst index 46b0ee6d542..ddbdb878f4d 100644 --- a/components/options_resolver.rst +++ b/components/options_resolver.rst @@ -862,10 +862,6 @@ if an unknown option is passed. You can ignore not defined options by using the 'version' => '1.2.3' ]); -.. versionadded:: 6.3 - - The ``ignoreUndefined()`` method was introduced in Symfony 6.3. - Chaining Option Configurations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index bfa69893bb9..0e92c345ad1 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -291,10 +291,6 @@ Here is a summary that should help you pick the right configuration: Ignoring Deprecations ..................... -.. versionadded:: 6.1 - - The ``ignoreFile`` feature was introduced in Symfony 6.1. - If your application has some deprecations that you can't fix for some reasons, you can tell Symfony to ignore them. @@ -541,10 +537,6 @@ allows you to mock the PHP's built-in time functions ``time()``, ``microtime()`` function ``date()`` is mocked so it uses the mocked time if no timestamp is specified. -.. versionadded:: 6.2 - - Support for mocking the ``hrtime()`` function was introduced in Symfony 6.2. - Other functions with an optional timestamp parameter that defaults to ``time()`` will still use the system time instead of the mocked time. This means that you may need to change some code in your tests. For example, instead of ``new DateTime()``, @@ -741,10 +733,6 @@ reason, this component also provides mocks for these PHP functions: * :phpfunction:`trait_exists` * :phpfunction:`enum_exists` -.. versionadded:: 6.3 - - The ``enum_exists`` function was introduced in Symfony 6.3. - Use Case ~~~~~~~~ @@ -816,10 +804,6 @@ PHP 8.1 and later, calling ``class_exists`` on a enum will return ``true``. That's why calling ``ClassExistsMock::withMockedEnums()`` will also register the enum as a mocked class. -.. versionadded:: 6.3 - - The ``enum_exists`` function was introduced in Symfony 6.3. - Troubleshooting --------------- diff --git a/components/process.rst b/components/process.rst index 158b8d0bd5a..999dd9d1f2e 100644 --- a/components/process.rst +++ b/components/process.rst @@ -413,10 +413,6 @@ instead:: Executing a PHP Child Process with the Same Configuration --------------------------------------------------------- -.. versionadded:: 6.4 - - The ``PhpSubprocess`` helper was introduced in Symfony 6.4. - When you start a PHP process, it uses the default configuration defined in your ``php.ini`` file. You can bypass these options with the ``-d`` command line option. For example, if ``memory_limit`` is set to ``256M``, you can disable this diff --git a/components/property_access.rst b/components/property_access.rst index c2a911e9b8e..1f3f28a6a1b 100644 --- a/components/property_access.rst +++ b/components/property_access.rst @@ -89,11 +89,6 @@ You can also use multi dimensional arrays:: Right square brackets ``]`` don't need to be escaped in array keys. - .. versionadded:: 6.3 - - Escaping dots and left square brackets in a property path was - introduced in Symfony 6.3. - Reading from Objects -------------------- @@ -236,10 +231,6 @@ is to mark all nullable properties with the nullsafe operator (``?``):: // no longer evaluated and null is returned immediately without throwing an exception var_dump($propertyAccessor->getValue($comment, 'person?.firstname')); // null -.. versionadded:: 6.2 - - The ``?`` nullsafe operator was introduced in Symfony 6.2. - .. _components-property-access-magic-get: Magic ``__get()`` Method diff --git a/components/property_info.rst b/components/property_info.rst index d5699ea1bab..38e00b5dfc1 100644 --- a/components/property_info.rst +++ b/components/property_info.rst @@ -229,12 +229,6 @@ works. It assumes camel case style method names following `PSR-1`_. For example, both ``myProperty`` and ``my_property`` properties are readable if there's a ``getMyProperty()`` method and writable if there's a ``setMyProperty()`` method. -.. versionadded:: 6.4 - - In Symfony versions prior to 6.4, snake case properties (e.g. ``my_property``) - were not writable by camel case methods (e.g. ``setMyProperty()``). You had - to define method names with underscores (e.g. ``setMy_property()``). - .. _property-info-initializable: Property Initializable Information diff --git a/components/serializer.rst b/components/serializer.rst index f879d5167c6..630ff1cf3b8 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -712,10 +712,6 @@ automatically detect and use it to serialize related attributes. The ``ObjectNormalizer`` also takes care of methods starting with ``has``, ``get``, and ``can``. -.. versionadded:: 6.1 - - The support of canners (methods prefixed by ``can``) was introduced in Symfony 6.1. - Using Callbacks to Serialize Properties with Object Instances ------------------------------------------------------------- @@ -811,11 +807,6 @@ The Serializer component provides several built-in normalizers: combine the following values: ``PropertyNormalizer::NORMALIZE_PUBLIC``, ``PropertyNormalizer::NORMALIZE_PROTECTED`` or ``PropertyNormalizer::NORMALIZE_PRIVATE``. - .. versionadded:: 6.2 - - The ``PropertyNormalizer::NORMALIZE_VISIBILITY`` context option and its - values were introduced in Symfony 6.2. - :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer` This normalizer works with classes that implement :phpclass:`JsonSerializable`. @@ -852,10 +843,6 @@ The Serializer component provides several built-in normalizers: By default, an exception is thrown when data is not a valid backed enumeration. If you want ``null`` instead, you can set the ``BackedEnumNormalizer::ALLOW_INVALID_VALUES`` option. - .. versionadded:: 6.3 - - The ``BackedEnumNormalizer::ALLOW_INVALID_VALUES`` context option was introduced in Symfony 6.3. - :class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer` This normalizer works with classes that implement :class:`Symfony\\Component\\Form\\FormInterface`. @@ -896,11 +883,6 @@ The Serializer component provides several built-in normalizers: setting the ``TranslatableNormalizer::NORMALIZATION_LOCALE_KEY`` serializer context option. - .. versionadded:: 6.4 - - The :class:`Symfony\\Component\\Serializer\\Normalizer\\TranslatableNormalizer` - was introduced in Symfony 6.4. - .. note:: You can also create your own Normalizer to use another structure. Read more at @@ -1030,10 +1012,6 @@ Option Description ``json_decode_recursion_depth`` Sets maximum recursion depth. ``512`` =============================== ========================================================================================================== ================================ -.. versionadded:: 6.4 - - The support of ``json_decode_detailed_errors`` was introduced in Symfony 6.4. - The ``CsvEncoder`` ~~~~~~~~~~~~~~~~~~ @@ -1252,10 +1230,6 @@ you can use "context builders" to define the context using a fluent interface:: $serializer->serialize($something, 'csv', $contextBuilder->toArray()); -.. versionadded:: 6.1 - - Context builders were introduced in Symfony 6.1. - .. note:: The Serializer component provides a context builder diff --git a/components/string.rst b/components/string.rst index ca289c70ba4..f743849fd19 100644 --- a/components/string.rst +++ b/components/string.rst @@ -565,10 +565,6 @@ the injected slugger is the same as the request locale:: Slug Emojis ~~~~~~~~~~~ -.. versionadded:: 6.2 - - The Emoji transliteration feature was introduced in Symfony 6.2. - You can transform any emojis into their textual representation:: use Symfony\Component\String\Slugger\AsciiSlugger; @@ -603,10 +599,6 @@ If you want to strip emojis from slugs, use the special ``strip`` locale:: $slug = $slugger->slug('a 😺, πŸˆβ€β¬›, and a 🦁'); // $slug = 'a-and-a'; -.. versionadded:: 6.3 - - The option to strip emojis from slugs was introduced in Symfony 6.3. - .. _string-inflector: Inflector diff --git a/components/uid.rst b/components/uid.rst index 52403513995..26fd32989a9 100644 --- a/components/uid.rst +++ b/components/uid.rst @@ -70,10 +70,6 @@ to create each type of UUID:: // UUIDv8 uniqueness will be implementation-specific and SHOULD NOT be assumed. $uuid = Uuid::v8(); -.. versionadded:: 6.2 - - UUID versions 7 and 8 were introduced in Symfony 6.2. - If your UUID value is already generated in another format, use any of the following methods to create a ``Uuid`` object from it:: @@ -184,10 +180,6 @@ Use these methods to transform the UUID object into different bases:: $uuid->toRfc4122(); // string(36) "d9e7a184-5d5b-11ea-a62a-3499710062d0" $uuid->toHex(); // string(34) "0xd9e7a1845d5b11eaa62a3499710062d0" -.. versionadded:: 6.2 - - The ``toHex()`` method was introduced in Symfony 6.2. - Working with UUIDs ~~~~~~~~~~~~~~~~~~ @@ -247,10 +239,6 @@ type, which converts to/from UUID objects automatically:: // ... } -.. versionadded:: 6.2 - - The ``UuidType::NAME`` constant was introduced in Symfony 6.2. - There's also a Doctrine generator to help auto-generate UUID values for the entity primary keys:: @@ -387,10 +375,6 @@ Use these methods to transform the ULID object into different bases:: $ulid->toRfc4122(); // string(36) "0171069d-593d-97d3-8b3e-23d06de5b308" $ulid->toHex(); // string(34) "0x0171069d593d97d38b3e23d06de5b308" -.. versionadded:: 6.2 - - The ``toHex()`` method was introduced in Symfony 6.2. - Working with ULIDs ~~~~~~~~~~~~~~~~~~ @@ -434,10 +418,6 @@ type, which converts to/from ULID objects automatically:: // ... } -.. versionadded:: 6.2 - - The ``UlidType::NAME`` constant was introduced in Symfony 6.2. - There's also a Doctrine generator to help auto-generate ULID values for the entity primary keys:: diff --git a/components/validator/resources.rst b/components/validator/resources.rst index d9d3543a641..d9b63a147d5 100644 --- a/components/validator/resources.rst +++ b/components/validator/resources.rst @@ -86,11 +86,6 @@ configure the locations of these files:: The AttributeLoader ------------------- -.. versionadded:: 6.4 - - The :class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AttributeLoader` - was introduced in Symfony 6.4. - The component provides an :class:`Symfony\\Component\\Validator\\Mapping\\Loader\\AttributeLoader` to get the metadata from the attributes of the class. For example:: diff --git a/components/var_dumper.rst b/components/var_dumper.rst index 6b336ad1d3e..06adc3a0021 100644 --- a/components/var_dumper.rst +++ b/components/var_dumper.rst @@ -485,10 +485,6 @@ then its dump representation:: .. image:: /_images/components/var_dumper/10-uninitialized.png :alt: Dump output where the uninitialized property is represented by a question mark followed by the type definition. -.. versionadded:: 6.4 - - Displaying uninitialized variables information was introduced in Symfony 6.4. - .. _var-dumper-advanced: Advanced Usage diff --git a/components/var_exporter.rst b/components/var_exporter.rst index 12c1396b0f1..17e2112210a 100644 --- a/components/var_exporter.rst +++ b/components/var_exporter.rst @@ -177,10 +177,6 @@ populated by using the special ``"\0"`` property name to define their internal v "\0" => [$inputArray], ]); -.. versionadded:: 6.2 - - The :class:`Symfony\\Component\\VarExporter\\Hydrator` was introduced in Symfony 6.2. - Creating Lazy Objects --------------------- @@ -288,10 +284,6 @@ Ghost objects unfortunately can't work with abstract classes or internal PHP classes. Nevertheless, the VarExporter component covers this need with the help of :ref:`Virtual Proxies `. -.. versionadded:: 6.2 - - The :class:`Symfony\\Component\\VarExporter\\LazyGhostTrait` was introduced in Symfony 6.2. - .. _var-exporter_virtual-proxies: LazyProxyTrait @@ -357,10 +349,5 @@ Just like ghost objects, while you never query ``$processor->hash``, its value will not be computed. The main difference with ghost objects is that this time, a proxy of an abstract class was created. This also works with internal PHP class. -.. versionadded:: 6.2 - - The :class:`Symfony\\Component\\VarExporter\\LazyProxyTrait` and - :class:`Symfony\\Component\\VarExporter\\ProxyHelper` were introduced in Symfony 6.2. - .. _`OPcache`: https://www.php.net/opcache .. _`PSR-2`: https://www.php-fig.org/psr/psr-2/ diff --git a/components/yaml.rst b/components/yaml.rst index 37d8064f235..ab4c0b6be22 100644 --- a/components/yaml.rst +++ b/components/yaml.rst @@ -355,10 +355,6 @@ and the special ``!php/enum`` syntax to parse them as proper PHP enums:: // the value of the 'foo' key is a string because it missed the `!php/enum` syntax // $parameters = ['foo' => 'FooEnum::Foo', 'bar' => 'foo']; -.. versionadded:: 6.2 - - The support for PHP enumerations was introduced in Symfony 6.2. - Parsing and Dumping of Binary Data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -422,10 +418,6 @@ By default, digit-only array keys are dumped as integers. You can use the $dumped = Yaml::dump([200 => 'foo'], 2, 4, Yaml::DUMP_NUMERIC_KEY_AS_STRING); // '200': foo -.. versionadded:: 6.3 - - The ``DUMP_NUMERIC_KEY_AS_STRING`` flag was introduced in Symfony 6.3. - Syntax Validation ~~~~~~~~~~~~~~~~~ diff --git a/configuration.rst b/configuration.rst index e4a923c5858..bcdebade23a 100644 --- a/configuration.rst +++ b/configuration.rst @@ -81,10 +81,6 @@ readable. These are the main advantages and disadvantages of each format: methods in the ``src/Kernel.php`` file to add support for the ``.xml`` file extension. - .. versionadded:: 6.1 - - The automatic loading of PHP configuration files was introduced in Symfony 6.1. - Importing Configuration Files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -292,14 +288,6 @@ reusable configuration value. By convention, parameters are defined under the something@example.com -.. versionadded:: 6.2 - - Passing an enum case as a service parameter was introduced in Symfony 6.2. - -.. versionadded:: 6.3 - - The ``trim`` attribute was introduced in Symfony 6.3. - Once defined, you can reference this parameter value from any other configuration file using a special syntax: wrap the parameter name in two ``%`` (e.g. ``%app.admin_email%``): @@ -395,10 +383,6 @@ a new ``locale`` parameter is added to the ``config/services.yaml`` file). They are useful when working with :ref:`Compiler Passes ` to declare some temporary parameters that won't be available later in the application. -.. versionadded:: 6.3 - - Compile-time parameters were introduced in Symfony 6.3. - .. seealso:: Later in this article you can read how to @@ -984,10 +968,6 @@ Use the ``debug:dotenv`` command to understand how Symfony parses the different # look for a specific variable passing its full or partial name as an argument $ php bin/console debug:dotenv foo -.. versionadded:: 6.2 - - The option to pass variable names to ``debug:dotenv`` was introduced in Symfony 6.2. - Additionally, and regardless of how you set environment variables, you can see all environment variables, with their values, referenced in Symfony's container configuration: diff --git a/configuration/env_var_processors.rst b/configuration/env_var_processors.rst index 4f600a5b34b..eba9f4a482c 100644 --- a/configuration/env_var_processors.rst +++ b/configuration/env_var_processors.rst @@ -418,10 +418,6 @@ Symfony provides the following env var processors: ->set(\RedisCluster::class, \RedisCluster::class)->args([null, '%env(shuffle:csv:REDIS_NODES)%']); }; - .. versionadded:: 6.2 - - The ``env(shuffle:...)`` env var processor was introduced in Symfony 6.2. - ``env(file:FOO)`` Returns the contents of a file whose path is the value of the ``FOO`` env var: @@ -782,10 +778,6 @@ Symfony provides the following env var processors: // config/services.php $container->setParameter('typed_env', '%env(enum:App\Enum\Environment:APP_ENV)%'); - .. versionadded:: 6.2 - - The ``env(enum:...)`` env var processor was introduced in Symfony 6.2. - ``env(defined:NO_FOO)`` Evaluates to ``true`` if the env var exists and its value is not ``''`` (an empty string) or ``null``; it returns ``false`` otherwise. @@ -820,10 +812,6 @@ Symfony provides the following env var processors: // config/services.php $container->setParameter('typed_env', '%env(defined:FOO)%'); - .. versionadded:: 6.4 - - The ``env(defined:...)`` env var processor was introduced in Symfony 6.4. - It is also possible to combine any number of processors: .. configuration-block:: diff --git a/configuration/micro_kernel_trait.rst b/configuration/micro_kernel_trait.rst index 890f3fc8b9c..26a332e4fdd 100644 --- a/configuration/micro_kernel_trait.rst +++ b/configuration/micro_kernel_trait.rst @@ -120,10 +120,6 @@ Next, create an ``index.php`` file that defines the kernel class and runs it: $response->send(); $kernel->terminate($request, $response); -.. versionadded:: 6.1 - - The PHP attributes notation has been introduced in Symfony 6.1. - That's it! To test it, start the :doc:`Symfony Local Web Server `: @@ -338,10 +334,6 @@ add a service conditionally based on the ``foo`` value:: } } -.. versionadded:: 6.1 - - The ``AbstractExtension`` class was introduced in Symfony 6.1. - Unlike the previous kernel, this loads an external ``config/framework.yaml`` file, because the configuration started to get bigger: diff --git a/console.rst b/console.rst index 1f468327d61..136d4c7f8fe 100644 --- a/console.rst +++ b/console.rst @@ -67,14 +67,6 @@ command, for instance: Console Completion ~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.1 - - Console completion for Fish was introduced in Symfony 6.1. - -.. versionadded:: 6.2 - - Console completion for Zsh was introduced in Symfony 6.2. - If you are using the Bash, Zsh or Fish shell, you can install Symfony's completion script to get auto completion when typing commands in the terminal. All commands support name and option completion, and some can @@ -356,10 +348,6 @@ method, which returns an instance of A new line is appended automatically when displaying information in a section. -.. versionadded:: 6.2 - - The feature to limit the height of a console section was introduced in Symfony 6.2. - Output sections let you manipulate the Console output in advanced ways, such as :ref:`displaying multiple progress bars ` which are updated independently and :ref:`appending rows to tables ` diff --git a/console/coloring.rst b/console/coloring.rst index a481b7650ff..346e0818a41 100644 --- a/console/coloring.rst +++ b/console/coloring.rst @@ -56,10 +56,6 @@ Any hex color is supported for foreground and background colors. Besides that, t the nearest color depending on the terminal capabilities. E.g. ``#c0392b`` is degraded to ``#d75f5f`` in 256-color terminals and to ``red`` in 8-color terminals. - .. versionadded:: 6.2 - - The support for 256-color terminals was introduced in Symfony 6.2. - And available options are: ``bold``, ``underscore``, ``blink``, ``reverse`` (enables the "reverse video" mode where the background and foreground colors are swapped) and ``conceal`` (sets the foreground color to transparent, making diff --git a/console/input.rst b/console/input.rst index ed637bdba74..4d709c18825 100644 --- a/console/input.rst +++ b/console/input.rst @@ -354,12 +354,6 @@ To achieve this, use the 5th argument of ``addArgument()``/``addOption``:: } } -.. versionadded:: 6.1 - - The argument to ``addOption()``/``addArgument()`` was introduced in - Symfony 6.1. Prior to this version, you had to override the - ``complete()`` method of the command. - That's all you need! Assuming users "Fabien" and "Fabrice" exist, pressing tab after typing ``app:greet Fa`` will give you these names as a suggestion. diff --git a/console/style.rst b/console/style.rst index bcc4d982457..0aaaa3f675e 100644 --- a/console/style.rst +++ b/console/style.rst @@ -333,10 +333,6 @@ User Input Methods $io->choice('Select the queue to analyze', ['queue1', 'queue2', 'queue3'], multiSelect: true); -.. versionadded:: 6.2 - - The ``multiSelect`` option of ``choice()`` was introduced in Symfony 6.2. - .. _symfony-style-blocks: Result Methods @@ -445,10 +441,6 @@ If you prefer to wrap all contents, including URLs, use this method:: } } -.. versionadded:: 6.2 - - The ``setAllowCutUrls()`` method was introduced in Symfony 6.2. - Defining your Own Styles ------------------------ diff --git a/contributing/documentation/format.rst b/contributing/documentation/format.rst index b403169cbaf..d933f3bcead 100644 --- a/contributing/documentation/format.rst +++ b/contributing/documentation/format.rst @@ -251,34 +251,34 @@ directive: .. code-block:: rst - .. versionadded:: 6.2 + .. versionadded:: 7.2 - ... ... ... was introduced in Symfony 6.2. + ... ... ... was introduced in Symfony 7.2. If you are documenting a behavior change, it may be helpful to *briefly* describe how the behavior has changed: .. code-block:: rst - .. versionadded:: 6.2 + .. versionadded:: 7.2 - ... ... ... was introduced in Symfony 6.2. Prior to this, + ... ... ... was introduced in Symfony 7.2. Prior to this, ... ... ... ... ... ... ... ... . -For a deprecation use the ``.. deprecated:: 6.x`` directive: +For a deprecation use the ``.. deprecated:: 7.x`` directive: .. code-block:: rst - .. deprecated:: 6.2 + .. deprecated:: 7.2 - ... ... ... was deprecated in Symfony 6.2. + ... ... ... was deprecated in Symfony 7.2. -Whenever a new major version of Symfony is released (e.g. 7.0, 8.0, etc), a new +Whenever a new major version of Symfony is released (e.g. 8.0, 9.0, etc), a new branch of the documentation is created from the ``x.4`` branch of the previous major version. At this point, all the ``versionadded`` and ``deprecated`` tags for Symfony versions that have a lower major version will be removed. For -example, if Symfony 7.0 were released today, 6.0 to 6.4 ``versionadded`` and -``deprecated`` tags would be removed from the new ``7.0`` branch. +example, if Symfony 8.0 were released today, 7.0 to 7.4 ``versionadded`` and +``deprecated`` tags would be removed from the new ``8.0`` branch. .. _reStructuredText: https://docutils.sourceforge.io/rst.html .. _Sphinx: https://www.sphinx-doc.org/ diff --git a/controller.rst b/controller.rst index 7afae06f728..891416d8aeb 100644 --- a/controller.rst +++ b/controller.rst @@ -229,10 +229,6 @@ command: You can read more about this attribute in :ref:`autowire-attribute`. - .. versionadded:: 6.1 - - The ``#[Autowire]`` attribute was introduced in Symfony 6.1. - Like with all services, you can also use regular :ref:`constructor injection ` in your controllers. @@ -383,11 +379,6 @@ attribute, arguments of your controller's action can be automatically fulfilled: // ... } -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapQueryParameter` attribute - was introduced in Symfony 6.3. - Mapping The Whole Query String ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -449,15 +440,6 @@ HTTP status to return if the validation fails:: The default status code returned if the validation fails is 404. -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapQueryString` attribute - was introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The ``validationFailedStatusCode`` parameter was introduced in Symfony 6.4. - Mapping Request Payload ~~~~~~~~~~~~~~~~~~~~~~~ @@ -546,15 +528,6 @@ if you want to map a nested array of specific DTOs:: ) {} } -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapRequestPayload` attribute - was introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The ``validationFailedStatusCode`` parameter was introduced in Symfony 6.4. - Managing the Session -------------------- @@ -728,11 +701,6 @@ The ``file()`` helper provides some arguments to configure its behavior:: Sending Early Hints ~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.3 - - The Early Hints helper of the ``AbstractController`` was introduced - in Symfony 6.3. - `Early hints`_ tell the browser to start downloading some assets even before the application sends the response content. This improves perceived performance because the browser can prefetch resources that will be needed once the full diff --git a/controller/value_resolver.rst b/controller/value_resolver.rst index 71efd680b08..abefc0efbb3 100644 --- a/controller/value_resolver.rst +++ b/controller/value_resolver.rst @@ -75,10 +75,6 @@ Symfony ships with the following value resolvers in the The example above allows requesting only ``/cards/D`` and ``/cards/S`` URLs and leads to 404 Not Found response in two other cases. - .. versionadded:: 6.1 - - The ``BackedEnumValueResolver`` and ``EnumRequirement`` were introduced in Symfony 6.1. - :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver` Attempts to find a request attribute that matches the name of the argument. @@ -98,16 +94,6 @@ Symfony ships with the following value resolvers in the receives when testing your application and using the :class:`Symfony\\Component\\Clock\\MockClock` implementation. - .. versionadded:: 6.1 - - The ``DateTimeValueResolver`` and the ``MapDateTime`` attribute were - introduced in Symfony 6.1. - - .. versionadded:: 6.3 - - The use of the :doc:`Clock component ` to generate the - ``DateTimeInterface`` object was introduced in Symfony 6.3. - :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestValueResolver` Injects the current ``Request`` if type-hinted with ``Request`` or a class extending ``Request``. @@ -147,10 +133,6 @@ Symfony ships with the following value resolvers in the } } - .. versionadded:: 6.1 - - The ``UidValueResolver`` was introduced in Symfony 6.1. - :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\VariadicValueResolver` Verifies if the request data is an array and will add all of them to the argument list. When the action is called, the last (variadic) argument will @@ -176,10 +158,6 @@ In addition, some components, bridges and official bundles provide other value r If the argument is not nullable and there is no logged in token, an ``HttpException`` with status code 401 is thrown by the resolver to prevent access to the controller. - .. versionadded:: 6.3 - - The ``SecurityTokenValueResolver`` was introduced in Symfony 6.3. - :class:`Symfony\\Bridge\\Doctrine\\ArgumentResolver\\EntityValueResolver` Automatically query for an entity and pass it as an argument to your controller. @@ -203,10 +181,6 @@ In addition, some components, bridges and official bundles provide other value r To learn more about the use of the ``EntityValueResolver``, see the dedicated section :ref:`Automatically Fetching Objects `. - .. versionadded:: 6.2 - - The ``EntityValueResolver`` was introduced in Symfony 6.2. - PSR-7 Objects Resolver: Injects a Symfony HttpFoundation ``Request`` object created from a PSR-7 object of type :class:`Psr\\Http\\Message\\ServerRequestInterface`, @@ -252,10 +226,6 @@ lets you do this by "targeting" the resolver you want:: } } -.. versionadded:: 6.3 - - The ``ValueResolver`` attribute was introduced in Symfony 6.3. - In the example above, the ``SessionValueResolver`` will be called first because it is targeted. The ``DefaultValueResolver`` will be called next if no value has been provided; that's why you can assign ``null`` as ``$session``'s default value. @@ -289,13 +259,6 @@ object whenever a controller argument has a type implementing } } -.. versionadded:: 6.2 - - The ``ValueResolverInterface`` was introduced in Symfony 6.2. Prior to - 6.2, you had to use the - :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentValueResolverInterface`, - which defines different methods. - Adding a new value resolver requires creating a class that implements :class:`Symfony\\Component\\HttpKernel\\Controller\\ValueResolverInterface` and defining a service for it. @@ -469,8 +432,3 @@ You can then pass this name as ``ValueResolver``'s first argument to target your // ... do something with $id } } - -.. versionadded:: 6.3 - - The ``controller.targeted_value_resolver`` tag and ``AsTargetedValueResolver`` - attribute were introduced in Symfony 6.3. diff --git a/doctrine.rst b/doctrine.rst index 0e8cd614598..b1931c5ddf8 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -606,10 +606,6 @@ the :ref:`doctrine-queries` section. Automatically Fetching Objects (EntityValueResolver) ---------------------------------------------------- -.. versionadded:: 6.2 - - Entity Value Resolver was introduced in Symfony 6.2. - .. versionadded:: 2.7.1 Autowiring of the ``EntityValueResolver`` was introduced in DoctrineBundle 2.7.1. @@ -758,11 +754,6 @@ variable. Let's say you pass the page limit of a list in a query parameter:: ): Response { } -.. versionadded:: 6.4 - - The support for the ``request`` variable in expressions was introduced - in Symfony 6.4. - MapEntity Options ~~~~~~~~~~~~~~~~~ diff --git a/form/unit_testing.rst b/form/unit_testing.rst index e191676215c..fbaa067858e 100644 --- a/form/unit_testing.rst +++ b/form/unit_testing.rst @@ -249,9 +249,4 @@ All you need to do is to implement the :method:`Symfony\\Bridge\\Twig\\Test\\FormLayoutTestCase::getTwigExtensions` and the :method:`Symfony\\Bridge\\Twig\\Test\\FormLayoutTestCase::getThemes` methods. -.. versionadded:: 6.4 - - The :class:`Symfony\\Bridge\\Twig\\Test\\FormLayoutTestCase` class was - introduced in Symfony 6.4. - .. _`PHPUnit data providers`: https://docs.phpunit.de/en/9.6/writing-tests-for-phpunit.html#data-providers diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index 8e655d69570..8317e5e3ecb 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -1,10 +1,6 @@ AssetMapper: Simple, Modern CSS & JS Management =============================================== -.. versionadded:: 6.3 - - The AssetMapper component was introduced in Symfony 6.3. - The AssetMapper component lets you write modern JavaScript and CSS without the complexity of using a bundler. Browsers *already* support many modern JavaScript features like the ``import`` statement and ES6 classes. And the HTTP/2 protocol means that @@ -238,10 +234,6 @@ directory and not commit it to your repository. Therefore, you'll need to run th ``php bin/console importmap:install`` command to download the files on other computers if some files are missing. -.. versionadded:: 6.4 - - The ``importmap:install`` command was introduced in Symfony 6.4. - .. note:: Sometimes, a package - like ``bootstrap`` - will have one or more dependencies, @@ -258,10 +250,6 @@ You can check for available updates for your third-party packages by running: # check for updates for the given list of packages $ php bin/console importmap:outdated bootstrap lodash -.. versionadded:: 6.4 - - The ``importmap:outdated`` command was introduced in Symfony 6.4. - To update third-party packages in your ``importmap.php`` file, run: .. code-block:: terminal @@ -680,11 +668,6 @@ same way:: If the :doc:`WebLink Component ` is available in your application, Symfony will add a ``Link`` header in the response to preload the CSS files. -.. versionadded:: 6.4 - - Automatic preloading of CSS files when WebLink is available was - introduced in Symfony 6.4. - Frequently Asked Questions -------------------------- @@ -1101,10 +1084,6 @@ command as part of your CI to be warned anytime a new vulnerability is found. The command takes a ``--format`` option to choose the output format between ``txt`` and ``json``. -.. versionadded:: 6.4 - - The ``importmap:audit`` command was introduced in Symfony 6.4. - .. _latest asset-mapper recipe: https://github.com/symfony/recipes/tree/main/symfony/asset-mapper .. _import statement: https://caniuse.com/es6-module-dynamic-import .. _ES6: https://caniuse.com/es6 diff --git a/html_sanitizer.rst b/html_sanitizer.rst index baef54e79d4..ea6eb0c8106 100644 --- a/html_sanitizer.rst +++ b/html_sanitizer.rst @@ -1,10 +1,6 @@ HTML Sanitizer ============== -.. versionadded:: 6.1 - - The HTML Sanitizer component was introduced in Symfony 6.1. - The HTML Sanitizer component aims at sanitizing/cleaning untrusted HTML code (e.g. created by a WYSIWYG editor in the browser) into HTML that can be trusted. It is based on the `HTML Sanitizer W3C Standard Proposal`_. diff --git a/http_cache.rst b/http_cache.rst index e1f1a57399c..38badf3a5c4 100644 --- a/http_cache.rst +++ b/http_cache.rst @@ -229,10 +229,6 @@ The *easiest* way to cache a response is by caching it for a specific amount of return $response; } -.. versionadded:: 6.2 - - The ``#[Cache()]`` attribute was introduced in Symfony 6.2. - Thanks to this new code, your HTTP response will have the following header: .. code-block:: text diff --git a/http_cache/esi.rst b/http_cache/esi.rst index aaf1de564c1..52a09fb16a7 100644 --- a/http_cache/esi.rst +++ b/http_cache/esi.rst @@ -279,8 +279,4 @@ The ``render_esi`` helper supports three other useful options: ``absolute_uri`` If set to true, an absolute URI will be generated. **default**: ``false`` -.. versionadded:: 6.2 - - The ``absolute_uri`` option was introduced in Symfony 6.2. - .. _`ESI`: https://www.w3.org/TR/esi-lang/ diff --git a/http_client.rst b/http_client.rst index 7b45c2cf2b4..083d6c83e70 100644 --- a/http_client.rst +++ b/http_client.rst @@ -618,13 +618,6 @@ of the opened file, but you can configure both with the PHP streaming configurat stream_context_set_option($fileHandle, 'http', 'filename', 'the-name.txt'); stream_context_set_option($fileHandle, 'http', 'content_type', 'my/content-type'); -.. versionadded:: 6.3 - - The feature to upload files using handles was introduced in Symfony 6.3. - In previous Symfony versions you had to encode the body contents according - to the ``multipart/form-data`` content-type using the :doc:`Symfony Mime ` - component. - .. tip:: When using multidimensional arrays the :class:`Symfony\\Component\\Mime\\Part\\Multipart\\FormDataPart` @@ -717,10 +710,6 @@ when using any HTTP method and ``500``, ``504``, ``507`` and ``510`` when using an HTTP `idempotent method`_. Use the ``max_retries`` setting to configure the amount of times a request is retried. -.. versionadded:: 6.4 - - The ``max_retries`` options was introduced in Symfony 6.4. - Check out the full list of configurable :ref:`retry_failed options ` to learn how to tweak each of them to fit your application needs. @@ -740,10 +729,6 @@ each retry. Retry Over Several Base URIs ............................ -.. versionadded:: 6.3 - - The multiple ``base_uri`` feature was added in Symfony 6.3. - The ``RetryableHttpClient`` can be configured to use multiple base URIs. This feature provides increased flexibility and reliability for making HTTP requests. Pass an array of base URIs as option ``base_uri`` when making a @@ -962,11 +947,6 @@ If you want to define your own logic to handle variables of URI templates, you can do so by redefining the ``http_client.uri_template_expander`` alias. Your service must be invokable. -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\HttpClient\\UriTemplateHttpClient` was - introduced in Symfony 6.3. - Performance ----------- @@ -1525,10 +1505,6 @@ to wrap your HTTP client, open a connection to a server that responds with a use the :method:`Symfony\\Component\\HttpClient\\Chunk\\ServerSentEvent::getArrayData` method to directly get the decoded JSON as array. -.. versionadded:: 6.3 - - The ``ServerSentEvent::getArrayData()`` method was introduced in Symfony 6.3. - Interoperability ---------------- @@ -1646,10 +1622,6 @@ You can also pass a set of default options to your client thanks to the // ... -.. versionadded:: 6.2 - - The ``Psr18Client::withOptions()`` method was introduced in Symfony 6.2. - HTTPlug ~~~~~~~ @@ -1751,10 +1723,6 @@ You can also pass a set of default options to your client thanks to the // ... -.. versionadded:: 6.2 - - The ``HttplugClient::withOptions()`` method was introduced in Symfony 6.2. - Native PHP Streams ~~~~~~~~~~~~~~~~~~ @@ -2096,10 +2064,6 @@ You can use :class:`Symfony\\Component\\HttpClient\\Response\\JsonMockResponse` 'foo' => 'bar', ]); -.. versionadded:: 6.3 - - The ``JsonMockResponse`` was introduced in Symfony 6.3. - Testing Request Data ~~~~~~~~~~~~~~~~~~~~ @@ -2251,10 +2215,6 @@ will find the associated response based on the request method, URL and body (if Note that **this won't work** if the request body or URI is random / always changing (e.g. if it contains current date or random UUIDs). -.. versionadded:: 6.4 - - The ``HarFileResponseFactory`` was introduced in Symfony 6.4. - Testing Network Transport Exceptions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2301,12 +2261,6 @@ you to do so, by yielding the exception from its body:: } } -.. versionadded:: 6.1 - - Being allowed to pass an exception directly to the body of a - :class:`Symfony\\Component\\HttpClient\\Response\\MockResponse` was - introduced in Symfony 6.1. - .. _`cURL PHP extension`: https://www.php.net/curl .. _`Zlib PHP extension`: https://www.php.net/zlib .. _`PSR-17`: https://www.php-fig.org/psr/psr-17/ diff --git a/lock.rst b/lock.rst index 35c3dc5be3c..d70f1d5535b 100644 --- a/lock.rst +++ b/lock.rst @@ -159,11 +159,6 @@ this behavior by using the ``lock`` key like: ; }; -.. versionadded:: 6.1 - - The CSV support (e.g. ``zookeeper://localhost01,localhost02:2181``) in - ZookeeperStore DSN was introduced in Symfony 6.1. - Locking a Resource ------------------ diff --git a/mailer.rst b/mailer.rst index fb05b7fe668..155ad1623a3 100644 --- a/mailer.rst +++ b/mailer.rst @@ -115,21 +115,6 @@ Service Install with `SendGrid`_ ``composer require symfony/sendgrid-mailer`` ===================== ============================================== -.. versionadded:: 6.2 - - The Infobip integration was introduced in Symfony 6.2 and the ``MailPace`` - integration was renamed in Symfony 6.2 (in previous Symfony versions it was - called ``OhMySMTP``). - -.. versionadded:: 6.3 - - The MailerSend integration was introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The ``Brevo`` (in previous Symfony versions it was called ``Sendinblue``) - and ``Scaleway`` integrations were introduced in Symfony 6.4. - .. note:: As a convenience, Symfony also provides support for Gmail (``composer @@ -227,10 +212,6 @@ party provider: | | - API sendgrid+api://KEY@default | +------------------------+-----------------------------------------------------+ -.. versionadded:: 6.3 - - The ``sandbox`` option in ``Mailjet`` API was introduced in Symfony 6.3. - .. caution:: If your credentials contain special characters, you must URL-encode them. @@ -344,10 +325,6 @@ may be specified as SHA1 or MD5 hash:: $dsn = 'smtp://user:pass@smtp.example.com?peer_fingerprint=6A1CF3B08D175A284C30BC10DE19162307C7286E'; -.. versionadded:: 6.4 - - The ``peer_fingerprint`` option was introduced in Symfony 6.4. - Overriding default SMTP authenticators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -373,11 +350,6 @@ This can be done from ``EsmtpTransport`` constructor or using the // Option 2: call a method to redefine the authenticators $transport->setAuthenticators([new XOAuth2Authenticator()]); -.. versionadded:: 6.3 - - The ``$authenticators`` constructor parameter and the ``setAuthenticators()`` - method were introduced in Symfony 6.3. - Other Options ~~~~~~~~~~~~~ @@ -413,10 +385,6 @@ Other Options $dsn = 'smtps://smtp.example.com?max_per_second=2' - .. versionadded:: 6.2 - - The ``max_per_second`` option was introduced in Symfony 6.2. - Creating & Sending Messages --------------------------- @@ -816,11 +784,6 @@ for Twig templates:: ]) ; -.. versionadded:: 6.4 - - The :method:`Symfony\\Bridge\\Twig\\Mime\\TemplatedEmail::locale` method - was introduced in Symfony 6.4. - Then, create the template: .. code-block:: html+twig @@ -1414,11 +1377,6 @@ the "rendering" of the email (computed headers, body rendering, ...) is also deferred and will only happen just before the email is sent by the Messenger handler. -.. versionadded:: 6.2 - - The following example about rendering the email before calling - ``$mailer->send($email)`` works as of Symfony 6.2. - When sending an email asynchronously, its instance must be serializable. This is always the case for :class:`Symfony\\Bridge\\Twig\\Mime\\Email` instances, but when sending a @@ -1492,11 +1450,6 @@ disable asynchronous delivery. an open connection to the SMTP server in between sending emails. You can do so by using the ``stop()`` method. -.. versionadded:: 6.1 - - The :method:`Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport::stop` - method was made public in Symfony 6.1. - You can also select the transport by adding an ``X-Bus-Transport`` header (which will be removed automatically from the final message):: @@ -1504,10 +1457,6 @@ will be removed automatically from the final message):: $email->getHeaders()->addTextHeader('X-Bus-Transport', 'app.another_bus'); $mailer->send($email); -.. versionadded:: 6.2 - - The ``X-Bus-Transport`` header support was introduced in Symfony 6.2. - Adding Tags and Metadata to Emails ---------------------------------- @@ -1549,17 +1498,9 @@ The following transports only support metadata: * Amazon SES (note that Amazon refers to this feature as "tags", but Symfony calls it "metadata" because it contains a key and a value) -.. versionadded:: 6.1 - - Metadata support for Amazon SES was introduced in Symfony 6.1. - Draft Emails ------------ -.. versionadded:: 6.1 - - ``Symfony\Component\Mime\DraftEmail`` was introduced in 6.1. - :class:`Symfony\\Component\\Mime\\DraftEmail` is a special instance of :class:`Symfony\\Component\\Mime\\Email`. Its purpose is to build up an email (with body, attachments, etc) and make available to download as an ``.eml`` with @@ -1631,10 +1572,6 @@ the email is sent:: $event->addStamp(new SomeMessengerStamp()); } -.. versionadded:: 6.2 - - Methods ``addStamp()`` and ``getStamps()`` were introduced in Symfony 6.2. - If you want to stop the Message from being sent, call ``reject()`` (it will also stop the event propagation):: @@ -1645,10 +1582,6 @@ also stop the event propagation):: $event->reject(); } -.. versionadded:: 6.3 - - The ``reject()`` method was introduced in Symfony 6.3. - Execute this command to find out which listeners are registered for this event and their priorities: @@ -1661,10 +1594,6 @@ SentMessageEvent **Event Class**: :class:`Symfony\\Component\\Mailer\\Event\\SentMessageEvent` -.. versionadded:: 6.2 - - The ``SentMessageEvent`` event was introduced in Symfony 6.2. - ``SentMessageEvent`` allows you to act on the :class:`Symfony\\Component\\\Mailer\\\SentMessage` class to access the original message (``getOriginalMessage()``) and some debugging information (``getDebug()``) such as the HTTP calls made by the HTTP transports, @@ -1696,10 +1625,6 @@ FailedMessageEvent **Event Class**: :class:`Symfony\\Component\\Mailer\\Event\\FailedMessageEvent` -.. versionadded:: 6.2 - - The ``FailedMessageEvent`` event was introduced in Symfony 6.2. - ``FailedMessageEvent`` allows acting on the the initial message in case of a failure:: use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -1749,10 +1674,6 @@ to test if sending emails works correctly: This command bypasses the :doc:`Messenger bus `, if configured, to ease testing emails even when the Messenger consumer is not running. -.. versionadded:: 6.2 - - The ``mailer:test`` command was introduced in Symfony 6.2. - Disabling Delivery ~~~~~~~~~~~~~~~~~~ diff --git a/messenger.rst b/messenger.rst index 39200f0cb70..1322841c974 100644 --- a/messenger.rst +++ b/messenger.rst @@ -71,10 +71,6 @@ message class (or a message interface):: methods. You may use the attribute on as many methods in a single class as you like, allowing you to group the handling of multiple related types of messages. -.. versionadded:: 6.1 - - Support for ``#[AsMessageHandler]`` on methods was introduced in Symfony 6.1. - Thanks to :ref:`autoconfiguration ` and the ``SmsNotification`` type-hint, Symfony knows that this handler should be called when an ``SmsNotification`` message is dispatched. Most of the time, this is all you need to do. But you can @@ -349,11 +345,6 @@ to multiple transports: name as its only argument. For more information about stamps, see `Envelopes & Stamps`_. -.. versionadded:: 6.2 - - The :class:`Symfony\\Component\\Messenger\\Stamp\\TransportNamesStamp` - stamp was introduced in Symfony 6.2. - Doctrine Entities in Messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -684,10 +675,6 @@ of some or all transports: In order for this command to work, the configured transport's receiver must implement :class:`Symfony\\Component\\Messenger\\Transport\\Receiver\\MessageCountAwareInterface`. -.. versionadded:: 6.2 - - The ``messenger:stats`` command was introduced in Symfony 6.2. - .. _messenger-supervisor: Supervisor Configuration @@ -769,10 +756,6 @@ However, you might prefer to use different POSIX signals for graceful shutdown. You can override default ones by setting the ``framework.messenger.stop_worker_on_signals`` configuration option. -.. versionadded:: 6.3 - - The ``framework.messenger.stop_worker_on_signals`` option was introduced in Symfony 6.3. - In some cases the ``SIGTERM`` signal is sent by Supervisor itself (e.g. stopping a Docker container having Supervisor as its entrypoint). In these cases you need to add a ``stopwaitsecs`` key to the program configuration (with a value @@ -985,10 +968,6 @@ this is configurable for each transport: the serialized form of the message is saved, which prevents to serialize it again if the message is later retried. - .. versionadded:: 6.1 - - The ``SerializedMessageStamp`` class was introduced in Symfony 6.1. - Avoiding Retrying ~~~~~~~~~~~~~~~~~ @@ -1105,15 +1084,6 @@ to retry them: # remove all messages in the failure transport $ php bin/console messenger:failed:remove --all -.. versionadded:: 6.2 - - The ``--class-filter`` and ``--stats`` options were introduced in Symfony 6.2. - -.. versionadded:: 6.4 - - The ``--all`` option was introduced in Symfony 6.4. - - If the message fails again, it will be re-sent back to the failure transport due to the normal :ref:`retry rules `. Once the max retry has been hit, the message will be discarded permanently. @@ -1389,10 +1359,6 @@ The transport has a number of options: ``exchange[type]`` Type of exchange ``fanout`` ============================================ ================================================= =================================== -.. versionadded:: 6.1 - - The ``connection_name`` option was introduced in Symfony 6.1. - You can also configure AMQP-specific settings on your message by adding :class:`Symfony\\Component\\Messenger\\Bridge\\Amqp\\Transport\\AmqpStamp` to your Envelope:: @@ -1615,15 +1581,6 @@ sentinel_master String, if null or empty Sentinel null support is disabled ======================= ===================================== ================================= -.. versionadded:: 6.1 - - The ``persistent_id``, ``retry_interval``, ``read_timeout``, ``timeout``, and - ``sentinel_master`` options were introduced in Symfony 6.1. - -.. versionadded:: 6.4 - - Support for the multiple Redis Sentinel hosts DNS was introduced in Symfony 6.4. - .. caution:: There should never be more than one ``messenger:consume`` command running with the same @@ -1782,10 +1739,6 @@ The transport has a number of options: ``wait_time`` `Long polling`_ duration in seconds 20 ====================== ====================================== =================================== -.. versionadded:: 6.1 - - The ``session_token`` option was introduced in Symfony 6.1. - .. note:: The ``wait_time`` parameter defines the maximum duration Amazon SQS should @@ -1929,12 +1882,6 @@ contains many useful information such as the exit code or the output of the process. You can refer to the page dedicated on :ref:`handler results ` for more information. -.. versionadded:: 6.4 - - The :class:`Symfony\\Component\\Console\\Messenger\\RunCommandMessage` - and :class:`Symfony\\Component\\Console\\Messenger\\RunCommandContext` - classes were introduced in Symfony 6.4. - Trigger An External Process ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1967,12 +1914,6 @@ contains many useful information such as the exit code or the output of the process. You can refer to the page dedicated on :ref:`handler results ` for more information. -.. versionadded:: 6.4 - - The :class:`Symfony\\Component\\Process\\Messenger\\RunProcessMessage` - and :class:`Symfony\\Component\\Process\\Messenger\\RunProcessContext` - classes were introduced in Symfony 6.4. - Pinging A Webservice -------------------- @@ -2013,11 +1954,6 @@ The handler will return a :class:`Symfony\\Contracts\\HttpClient\\ResponseInterface`, allowing you to gather and process information returned by the HTTP request. -.. versionadded:: 6.4 - - The :class:`Symfony\\Component\\HttpClient\\Messenger\\PingWebhookMessage` - class was introduced in Symfony 6.4. - Getting Results from your Handlers ---------------------------------- @@ -2538,11 +2474,6 @@ provided in order to ease the declaration of these special handlers:: } } -.. versionadded:: 6.3 - - The :method:`Symfony\\Component\\Messenger\\Handler\\BatchHandlerTrait::getBatchSize` - method was introduced in Symfony 6.3. - .. note:: When the ``$ack`` argument of ``__invoke()`` is ``null``, the message is @@ -2868,10 +2799,6 @@ of the process. For each, the event class is the event name: * :class:`Symfony\\Component\\Messenger\\Event\\WorkerStartedEvent` * :class:`Symfony\\Component\\Messenger\\Event\\WorkerStoppedEvent` -.. versionadded:: 6.2 - - The ``WorkerRateLimitedEvent`` was introduced in Symfony 6.2. - Additional Handler Arguments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2920,11 +2847,6 @@ Then your handler will look like this:: } } -.. versionadded:: 6.2 - - The :class:`Symfony\\Component\\Messenger\\Stamp\\HandlerArgumentsStamp` - was introduced in Symfony 6.2. - .. _messenger-multiple-buses: Multiple Buses, Command & Event Buses @@ -3038,10 +2960,6 @@ an **event bus**. The event bus could have zero or more subscribers. $eventBus->middleware()->id('validation'); }; -.. versionadded:: 6.2 - - The ``allow_no_senders`` option was introduced in Symfony 6.2. - This will create three new services: * ``command.bus``: autowireable with the :class:`Symfony\\Component\\Messenger\\MessageBusInterface` @@ -3247,12 +3165,6 @@ will take care of this message to redispatch it through the same bus it was dispatched at first. You can also use the second argument of the ``RedispatchMessage`` constructor to provide transports to use when redispatching the message. -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\Messenger\\Message\\RedispatchMessage` - and :class:`Symfony\\Component\\Messenger\\Handler\\RedispatchMessageHandler` - classes were introduced in Symfony 6.3. - Learn more ---------- diff --git a/notifier.rst b/notifier.rst index c617ea8224d..3127ec05bc1 100644 --- a/notifier.rst +++ b/notifier.rst @@ -102,26 +102,6 @@ Service Package DSN `Yunpian`_ ``symfony/yunpian-notifier`` ``yunpian://APIKEY@default`` ================== ===================================== =========================================================================== -.. versionadded:: 6.1 - - The 46elks, OrangeSms, KazInfoTeh and Sendberry integrations were introduced in Symfony 6.1. - The ``no_stop_clause`` option in ``OvhCloud`` DSN was introduced in Symfony 6.1. - The ``test`` option in ``Smsapi`` DSN was introduced in Symfony 6.1. - -.. versionadded:: 6.2 - - The ContactEveryone and SMSFactor integrations were introduced in Symfony 6.2. - -.. versionadded:: 6.3 - - The Bandwith, iSendPro, Plivo, RingCentral, SimpleTextin and Termii integrations - were introduced in Symfony 6.3. - The ``from`` option in ``Smsapi`` DSN is optional since Symfony 6.3. - -.. versionadded:: 6.4 - - The `Redlink`_ and `Brevo`_ integrations were introduced in Symfony 6.4. - To enable a texter, add the correct DSN in your ``.env`` file and configure the ``texter_transports``: @@ -211,14 +191,6 @@ send SMS messages:: } } -.. versionadded:: 6.2 - - The 3rd argument of ``SmsMessage`` (``$from``) was introduced in Symfony 6.2. - -.. versionadded:: 6.3 - - The 4th argument of ``SmsMessage`` (``$options``) was introduced in Symfony 6.3. - The ``send()`` method returns a variable of type :class:`Symfony\\Component\\Notifier\\Message\\SentMessage` which provides information such as the message ID and the original message contents. @@ -263,14 +235,6 @@ Service Package D `Zulip`_ ``symfony/zulip-notifier`` ``zulip://EMAIL:TOKEN@HOST?channel=CHANNEL`` ====================================== ==================================== ============================================================================= -.. versionadded:: 6.2 - - The Zendesk and Chatwork integration were introduced in Symfony 6.2. - -.. versionadded:: 6.3 - - The LINE Notify, Mastodon and Twitter integrations were introduced in Symfony 6.3. - Chatters are configured using the ``chatter_transports`` setting: .. code-block:: bash @@ -450,18 +414,6 @@ Service Package DSN `Pushover`_ ``symfony/pushover-notifier`` ``pushover://USER_KEY:APP_TOKEN@default`` =============== ==================================== ============================================================================== -.. versionadded:: 6.1 - - The Engagespot integration was introduced in Symfony 6.1. - -.. versionadded:: 6.3 - - The PagerDuty and Pushover integrations were introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The Novu, Ntfy and GoIP integrations were introduced in Symfony 6.4. - To enable a texter, add the correct DSN in your ``.env`` file and configure the ``texter_transports``: @@ -823,10 +775,6 @@ also exists to modify messages sent to those channels. Customize Browser Notifications (Flash Messages) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.1 - - Support for customizing importance levels was introduced in Symfony 6.1. - The default behavior for browser channel notifications is to add a :ref:`flash message ` with ``notification`` as its key. @@ -886,11 +834,6 @@ You can benefit from this class by using it directly or extending the See :ref:`testing documentation ` for the list of available assertions. -.. versionadded:: 6.2 - - The :class:`Symfony\\Bundle\\FrameworkBundle\\Test\\NotificationAssertionsTrait` - was introduced in Symfony 6.2. - Disabling Delivery ------------------ diff --git a/performance.rst b/performance.rst index 847da532769..1bb0e261c74 100644 --- a/performance.rst +++ b/performance.rst @@ -261,10 +261,6 @@ in performance, you can stop generating the file as follows: // ... $container->parameters()->set('debug.container.dump', false); -.. versionadded:: 6.3 - - The ``debug.container.dump`` option was introduced in Symfony 6.3. - .. _profiling-applications: Profiling Symfony Applications diff --git a/profiler.rst b/profiler.rst index b21132a5816..c0d3640109b 100644 --- a/profiler.rst +++ b/profiler.rst @@ -35,10 +35,6 @@ Symfony Profiler, which will look like this: in the ``X-Debug-Token-Link`` HTTP response header. Browse the ``/_profiler`` URL to see all profiles. -.. versionadded:: 6.3 - - Profile garbage collection was introduced in Symfony 6.3. - .. note:: To limit the storage used by profiles on disk, they are probabilistically @@ -91,10 +87,6 @@ look for tokens based on some criteria:: // gets the latest 10 tokens for requests that happened between 2 and 4 days ago $tokens = $profiler->find('', '', 10, '', '4 days ago', '2 days ago'); -.. versionadded:: 6.4 - - Prefixing the URL filter with a ``!`` symbol to negate the query was introduced in Symfony 6.4. - Data Collectors --------------- diff --git a/rate_limiter.rst b/rate_limiter.rst index 1fe86ef020a..5cb5cbfd918 100644 --- a/rate_limiter.rst +++ b/rate_limiter.rst @@ -320,11 +320,6 @@ processes by reserving unused tokens. $limit->wait(); } while (!$limit->isAccepted()); -.. versionadded:: 6.4 - - The support for the ``reserve()`` method for the ``SlidingWindow`` strategy - was introduced in Symfony 6.4. - Exposing the Rate Limiter Status ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -370,11 +365,6 @@ the :class:`Symfony\\Component\\RateLimiter\\Reservation` object returned by the } } -.. versionadded:: 6.4 - - The :method:`Symfony\\Component\\RateLimiter\\Policy\\SlidingWindow::calculateTimeForTokens` - method was introduced in Symfony 6.4. - .. _rate-limiter-storage: Storing Rate Limiter State diff --git a/reference/configuration/debug.rst b/reference/configuration/debug.rst index 482396d2ae2..62cc40675b2 100644 --- a/reference/configuration/debug.rst +++ b/reference/configuration/debug.rst @@ -17,10 +17,6 @@ key in your application configuration. # environment variables with their actual values $ php bin/console debug:config --resolve-env framework -.. versionadded:: 6.2 - - The ``--resolve-env`` option was introduced in Symfony 6.2. - .. note:: When using XML, you must use the ``http://symfony.com/schema/dic/debug`` diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index aefbcac2fce..f31921cfc9c 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -60,10 +60,6 @@ thrown by the application and will turn them into HTTP responses. Starting from Symfony 7.0, the default value of this option will be ``true``. -.. versionadded:: 6.2 - - The ``handle_all_throwables`` option was introduced in Symfony 6.2. - .. _configuration-framework-http_cache: http_cache @@ -124,10 +120,6 @@ skip_response_headers Set of response headers that will never be cached even when the response is cacheable and public. -.. versionadded:: 6.3 - - The ``skip_response_headers`` option was introduced in Symfony 6.3. - allow_reload ............ @@ -210,10 +202,6 @@ trust_x_sendfile_type_header **type**: ``boolean`` **default**: ``false`` -.. versionadded:: 6.1 - - The ``trust_x_sendfile_type_header`` option was introduced in Symfony 6.1. - ``X-Sendfile`` is a special HTTP header that tells web servers to replace the response contents by the file that is defined in that header. This improves performance because files are no longer served by your application but directly @@ -300,10 +288,6 @@ feature is to configure it on a system level. First, you can define this option in the ``SYMFONY_IDE`` environment variable, which Symfony reads automatically when ``framework.ide`` config is not set. -.. versionadded:: 6.1 - - ``SYMFONY_IDE`` environment variable support was introduced in Symfony 6.1. - Another alternative is to set the ``xdebug.file_link_format`` option in your ``php.ini`` configuration file. The format to use is the same as for the ``framework.ide`` option, but without the need to escape the percent signs @@ -1016,10 +1000,6 @@ crypto_method The minimum version of TLS to accept. The value must be one of the ``STREAM_CRYPTO_METHOD_TLSv*_CLIENT`` constants defined by PHP. -.. versionadded:: 6.3 - - The ``crypto_method`` option was introduced in Symfony 6.3. - delay ..... @@ -1045,10 +1025,6 @@ extra Arbitrary additional data to pass to the HTTP client for further use. This can be particularly useful when :ref:`decorating an existing client `. -.. versionadded:: 6.3 - - The ``extra`` option has been introduced in Symfony 6.3. - .. _http-headers: headers @@ -1263,10 +1239,6 @@ enough to be sure about the server, so you should combine this with the html_sanitizer ~~~~~~~~~~~~~~ -.. versionadded:: 6.1 - - The HTML sanitizer configuration was introduced in Symfony 6.1. - The ``html_sanitizer`` option (and its children) are used to configure custom HTML sanitizers. Read more about the options in the :ref:`HTML sanitizer documentation `. @@ -1357,10 +1329,6 @@ Set this option to ``true`` to enable the serializer data collector and its profiler panel. When this option is ``true``, all normalizers and encoders are decorated by traceable implementations that collect profiling information about them. -.. versionadded:: 6.1 - - The ``collect_serializer_data`` option was introduced in Symfony 6.1. - rate_limiter ~~~~~~~~~~~~ @@ -1542,10 +1510,6 @@ cache_dir The directory where routing information will be cached. Can be set to ``~`` (``null``) to disable route caching. -.. versionadded:: 6.2 - - The ``cache_dir`` setting was introduced in Symfony 6.2. - secrets ~~~~~~~ @@ -3374,10 +3338,6 @@ Name of the lock you want to create. semaphore ~~~~~~~~~ -.. versionadded:: 6.1 - - The ``semaphore`` option was introduced in Symfony 6.1. - **type**: ``string`` | ``array`` The default semaphore adapter. Store's DSN are also allowed. @@ -3824,10 +3784,6 @@ to the ``#[WithHttpStatus]`` attribute on the exception class:: { } -.. versionadded:: 6.3 - - The ``#[WithHttpStatus]`` attribute was introduced in Symfony 6.3. - It is also possible to map a log level on a custom exception class using the ``#[WithLogLevel]`` attribute:: @@ -3841,10 +3797,6 @@ the ``#[WithLogLevel]`` attribute:: { } -.. versionadded:: 6.3 - - The ``#[WithLogLevel]`` attribute was introduced in Symfony 6.3. - .. _`HTTP Host header attacks`: https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html .. _`Security Advisory Blog post`: https://symfony.com/blog/security-releases-symfony-2-0-24-2-1-12-2-2-5-and-2-3-3-released#cve-2013-4752-request-gethost-poisoning .. _`PhpStormProtocol`: https://github.com/aik099/PhpStormProtocol diff --git a/reference/configuration/kernel.rst b/reference/configuration/kernel.rst index c6c0669d1a4..2bfa662db8c 100644 --- a/reference/configuration/kernel.rst +++ b/reference/configuration/kernel.rst @@ -25,11 +25,6 @@ method of the kernel class, which you can override to return a different value. You can also change the build directory by defining an environment variable named ``APP_BUILD_DIR`` whose value is the absolute path of the build folder. -.. versionadded:: 6.4 - - The support of the ``APP_BUILD_DIR`` environment variable was introduced in - Symfony 6.4. - ``kernel.bundles`` ------------------ diff --git a/reference/configuration/security.rst b/reference/configuration/security.rst index d6ffd07f102..aaa862fd2f1 100644 --- a/reference/configuration/security.rst +++ b/reference/configuration/security.rst @@ -497,10 +497,6 @@ It's also possible to use ``*`` as a wildcard for all directives: ], ]); -.. versionadded:: 6.3 - - The ``clear_site_data`` option was introduced in Symfony 6.3. - invalidate_session .................. @@ -541,10 +537,6 @@ Set this option to ``true`` to enable CSRF protection in the logout process using Symfony's default CSRF token manager. Set also the ``csrf_token_manager`` option if you need to use a custom CSRF token manager. -.. versionadded:: 6.2 - - The ``enable_csrf`` option was introduced in Symfony 6.2. - csrf_parameter .............. @@ -807,10 +799,6 @@ user_identifier **type**: ``string`` **default**: ``emailAddress`` -.. versionadded:: 6.3 - - The ``user_identifier`` option was introduced in Symfony 6.3. - The value of this option tells Symfony which parameter to use to find the user identifier in the "distinguished name". @@ -1013,10 +1001,6 @@ the session must not be used when authenticating users: Routes under this firewall will be :ref:`configured stateless ` when they are not explicitly configured stateless or not. -.. versionadded:: 6.3 - - Stateless firewall marking routes stateless was introduced in Symfony 6.3. - User Checkers ~~~~~~~~~~~~~ diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst index 78a895bb4b8..883b0b11eb7 100644 --- a/reference/configuration/twig.rst +++ b/reference/configuration/twig.rst @@ -57,11 +57,6 @@ called to determine the default escaping applied to the template. If the service defined in ``autoescape_service`` is invocable (i.e. it defines the `__invoke() PHP magic method`_) you can omit this option. -.. versionadded:: 6.4 - - The feature to use invocable services to omit this option was introduced in - Symfony 6.4. - base_template_class ~~~~~~~~~~~~~~~~~~~ @@ -155,10 +150,6 @@ file_name_pattern **type**: ``string`` or ``array`` of ``string`` **default**: ``[]`` -.. versionadded:: 6.1 - - The ``file_name_pattern`` option was introduced in Symfony 6.1. - Some applications store their front-end assets in the same directory as Twig templates. The ``lint:twig`` command filters those files to only lint the ones that match the ``*.twig`` filename pattern. @@ -289,10 +280,6 @@ html_to_text_converter **type**: ``string`` **default**: ```` -.. versionadded:: 6.2 - - The ``html_to_text_converter`` option was introduced in Symfony 6.2. - The service implementing :class:`Symfony\\Component\\Mime\\HtmlToTextConverter\\HtmlToTextConverterInterface` that will be used to automatically create the text part of an email from its diff --git a/reference/constraints/Cascade.rst b/reference/constraints/Cascade.rst index bd6050add0b..3c99f423b0f 100644 --- a/reference/constraints/Cascade.rst +++ b/reference/constraints/Cascade.rst @@ -95,8 +95,4 @@ The ``groups`` option is not available for this constraint. This option can be used to exclude one or more properties from the cascade validation. -.. versionadded:: 6.3 - - The ``exclude`` option was introduced in Symfony 6.3. - .. include:: /reference/constraints/_payload-option.rst.inc diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index 8e3b11a01ce..cd30e888245 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -315,10 +315,6 @@ When this option is ``false``, the constraint checks that the given value is not one of the values defined in the ``choices`` option. In practice, it makes the ``Choice`` constraint behave like a ``NotChoice`` constraint. -.. versionadded:: 6.2 - - The ``match`` option was introduced in Symfony 6.2. - ``message`` ~~~~~~~~~~~ diff --git a/reference/constraints/Email.rst b/reference/constraints/Email.rst index 3f4207471c1..516d6d07dca 100644 --- a/reference/constraints/Email.rst +++ b/reference/constraints/Email.rst @@ -116,10 +116,6 @@ This option defines the pattern used to validate the email address. Valid values `egulias/email-validator`_ library (which is already installed when using :doc:`Symfony Mailer `; otherwise, you must install it separately). -.. versionadded:: 6.2 - - The ``html5-allow-no-tld`` mode was introduced in 6.2. - .. tip:: The possible values of this option are also defined as PHP constants of diff --git a/reference/constraints/Expression.rst b/reference/constraints/Expression.rst index 1f3b4dcdb7c..bf015d17573 100644 --- a/reference/constraints/Expression.rst +++ b/reference/constraints/Expression.rst @@ -127,10 +127,6 @@ about the :doc:`expression language syntax evaluate('fruit?.color', ['fruit' => '...']) $expressionLanguage->evaluate('fruit?.getStock()', ['fruit' => '...']) -.. versionadded:: 6.1 - - The null safe operator was introduced in Symfony 6.1. - .. _component-expression-functions: Working with Functions @@ -176,10 +167,6 @@ This function will return the case of an enumeration:: This will print out ``true``. -.. versionadded:: 6.3 - - The ``enum()`` function was introduced in Symfony 6.3. - .. tip:: To read how to register your own functions to use in an expression, see @@ -255,11 +242,6 @@ Comparison Operators * ``starts with`` * ``ends with`` -.. versionadded:: 6.1 - - The ``contains``, ``starts with`` and ``ends with`` operators were introduced - in Symfony 6.1. - .. tip:: To test if a string does *not* match a regex, use the logical ``not`` diff --git a/reference/formats/yaml.rst b/reference/formats/yaml.rst index 3130dd1d87b..64adac599fb 100644 --- a/reference/formats/yaml.rst +++ b/reference/formats/yaml.rst @@ -346,10 +346,6 @@ official YAML specification but are useful in Symfony applications: # ... or you can also use "->value" to directly use the value of a BackedEnum case operator_type: !php/enum App\Operator\Enum\Type::Or->value -.. versionadded:: 6.2 - - The ``!php/enum`` tag was introduced in Symfony 6.2. - Unsupported YAML Features ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index c18c558dbdc..d21802bbb91 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -200,10 +200,6 @@ prototype_options **type**: ``array`` **default**: ``[]`` -.. versionadded:: 6.1 - - The ``prototype_options`` option was introduced in Symfony 6.1. - This is the array that's passed to the form type specified in the `entry_type`_ option when creating its prototype. It allows to have different options depending on whether you are adding a new entry or editing an existing entry:: diff --git a/reference/forms/types/enum.rst b/reference/forms/types/enum.rst index 12fdc125177..eb22715407f 100644 --- a/reference/forms/types/enum.rst +++ b/reference/forms/types/enum.rst @@ -80,10 +80,6 @@ implement ``TranslatableInterface`` to translate or display custom labels:: } } -.. versionadded:: 6.4 - - Support for ``TranslatableInterface`` was introduced in Symfony 6.4. - Field Options ------------- diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index 04a3676f7d4..77e685486a8 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -60,10 +60,6 @@ include an `inputmode HTML attribute`_ which depends on the value of this option If the ``scale`` value is ``0``, ``inputmode`` will be ``numeric``; if ``scale`` is set to any value greater than ``0``, ``inputmode`` will be ``decimal``. -.. versionadded:: 6.1 - - The automatic addition of the ``inputmode`` attribute was introduced in Symfony 6.1. - Overridden Options ------------------ diff --git a/reference/forms/types/options/choice_label.rst.inc b/reference/forms/types/options/choice_label.rst.inc index 0071498916f..3d83e44da52 100644 --- a/reference/forms/types/options/choice_label.rst.inc +++ b/reference/forms/types/options/choice_label.rst.inc @@ -29,12 +29,6 @@ more control:: }, ]); -.. versionadded:: 6.2 - - Starting from Symfony 6.2, you can use any object that implements - :class:`Symfony\\Contracts\\Translation\\TranslatableInterface` as the value - of the choice label. - This method is called for *each* choice, passing you the ``$choice`` and ``$key`` from the choices array (additional ``$value`` is related to `choice_value`_). This will give you: diff --git a/reference/forms/types/options/duplicate_preferred_choices.rst.inc b/reference/forms/types/options/duplicate_preferred_choices.rst.inc index 72e85067bd3..7569d54a21b 100644 --- a/reference/forms/types/options/duplicate_preferred_choices.rst.inc +++ b/reference/forms/types/options/duplicate_preferred_choices.rst.inc @@ -20,7 +20,3 @@ option to ``false``, to only display preferred choices at the top of the list:: 'preferred_choices' => ['muppets', 'arr'], 'duplicate_preferred_choices' => false, ]); - -.. versionadded:: 6.4 - - The ``duplicate_preferred_choices`` option was introduced in Symfony 6.4. diff --git a/reference/forms/types/options/help.rst.inc b/reference/forms/types/options/help.rst.inc index 8c9bb5ce917..7d8fcdbec6b 100644 --- a/reference/forms/types/options/help.rst.inc +++ b/reference/forms/types/options/help.rst.inc @@ -19,8 +19,3 @@ rendered below the field:: 'help' => new TranslatableMessage('order.status', ['%order_id%' => $order->getId()], 'store'), ]) ; - -.. versionadded:: 6.2 - - The support for ``TranslatableInterface`` objects as help contents was - introduced in Symfony 6.2. diff --git a/reference/forms/types/options/placeholder_attr.rst.inc b/reference/forms/types/options/placeholder_attr.rst.inc index 49b656cc6df..e537aae8922 100644 --- a/reference/forms/types/options/placeholder_attr.rst.inc +++ b/reference/forms/types/options/placeholder_attr.rst.inc @@ -15,7 +15,3 @@ Use this to add additional HTML attributes to the placeholder choice:: ['title' => 'Choose an option'], ], ]); - -.. versionadded:: 6.3 - - The ``placeholder_attr`` option was introduced in Symfony 6.3. diff --git a/reference/forms/types/options/sanitize_html.rst.inc b/reference/forms/types/options/sanitize_html.rst.inc index d5525674815..1f906fd1354 100644 --- a/reference/forms/types/options/sanitize_html.rst.inc +++ b/reference/forms/types/options/sanitize_html.rst.inc @@ -3,10 +3,6 @@ sanitize_html **type**: ``boolean`` **default**: ``false`` -.. versionadded:: 6.1 - - The ``sanitize_html`` option was introduced in Symfony 6.1. - When ``true``, the text input will be sanitized using the :doc:`Symfony HTML Sanitizer component ` after the form is submitted. This protects the form input against XSS, clickjacking and CSS diff --git a/reference/forms/types/options/sanitizer.rst.inc b/reference/forms/types/options/sanitizer.rst.inc index 66a76d591e7..39217653b3c 100644 --- a/reference/forms/types/options/sanitizer.rst.inc +++ b/reference/forms/types/options/sanitizer.rst.inc @@ -3,9 +3,5 @@ sanitizer **type**: ``string`` **default**: ``"default"`` -.. versionadded:: 6.1 - - The ``sanitizer`` option was introduced in Symfony 6.1. - When `sanitize_html`_ is enabled, you can specify the name of a :ref:`custom sanitizer ` using this option. diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index d9b0f4cf066..d244a784755 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -37,10 +37,6 @@ entered into the box, set this to false and submit the form. **type**: ``string`` **default**: ``null`` -.. versionadded:: 6.2 - - The ``hash_property_path`` option was introduced in Symfony 6.2. - If set, the password will be hashed using the :doc:`PasswordHasher component ` and stored in the property defined by the given :doc:`PropertyAccess expression `. diff --git a/reference/twig_reference.rst b/reference/twig_reference.rst index 47b06ec2ea4..ef806adbc59 100644 --- a/reference/twig_reference.rst +++ b/reference/twig_reference.rst @@ -300,10 +300,6 @@ Generates a URL that you can visit to :doc:`impersonate a user `, identified by the ``identifier`` argument. -.. versionadded:: 6.4 - - The ``impersonation_path()`` function was introduced in Symfony 6.4. - impersonation_url ~~~~~~~~~~~~~~~~~ @@ -317,10 +313,6 @@ impersonation_url It's similar to the `impersonation_path`_ function, but it generates absolute URLs instead of relative URLs. -.. versionadded:: 6.4 - - The ``impersonation_url()`` function was introduced in Symfony 6.4. - impersonation_exit_path ~~~~~~~~~~~~~~~~~~~~~~~ @@ -442,10 +434,6 @@ Translates the text into the current language. More information in sanitize_html ~~~~~~~~~~~~~ -.. versionadded:: 6.1 - - The ``sanitize_html()`` filter was introduced in Symfony 6.1. - .. code-block:: twig {{ body|sanitize_html(sanitizer = "default") }} diff --git a/routing.rst b/routing.rst index fb5931cc517..8a75eb195cb 100644 --- a/routing.rst +++ b/routing.rst @@ -48,10 +48,6 @@ classes declared in the ``App\Controller`` namespace and stored in the act as a controller too, which is especially useful for small applications that use Symfony as a microframework. -.. versionadded:: 6.2 - - The feature to import routes from a PSR-4 namespace root was introduced in Symfony 6.2. - Suppose you want to define a route for the ``/blog`` URL in your application. To do so, create a :doc:`controller class ` like the following: @@ -374,10 +370,6 @@ can use any of these variables created by Symfony: An array of matched :ref:`route parameters ` for the current route. -.. versionadded:: 6.1 - - The ``params`` variable was introduced in Symfony 6.1. - You can also use these functions: ``env(string $name)`` @@ -408,11 +400,6 @@ You can also use these functions: // Or without alias: #[Route(condition: "service('App\\\Service\\\RouteChecker').check(request)")] -.. versionadded:: 6.1 - - The ``service(string $alias)`` function and ``#[AsRoutingConditionService]`` - attribute were introduced in Symfony 6.1. - Behind the scenes, expressions are compiled down to raw PHP. Because of this, using the ``condition`` key causes no extra overhead beyond the time it takes for the underlying PHP to execute. @@ -467,10 +454,6 @@ route details: Use the ``--show-aliases`` option to show all available aliases for a given route. -.. versionadded:: 6.4 - - The ``--show-aliases`` option was introduced in Symfony 6.4. - The other command is called ``router:match`` and it shows which route will match the given URL. It's useful to find out why some URL is not executing the controller action that you expect: @@ -664,10 +647,6 @@ URL Route Parameters contains a collection of commonly used regular-expression constants such as digits, dates and UUIDs which can be used as route parameter requirements. - .. versionadded:: 6.1 - - The ``Requirement`` enum was introduced in Symfony 6.1. - .. tip:: Route requirements (and route paths too) can include @@ -956,12 +935,6 @@ A common routing need is to convert the value stored in some parameter (e.g. an integer acting as the user ID) into another value (e.g. the object that represents the user). This feature is called a "param converter". -.. versionadded:: 6.2 - - Starting from Symfony 6.2, route param conversion is a built-in feature. - In previous Symfony versions you had to install the package - ``sensio/framework-extra-bundle`` before using this feature. - Now, keep the previous route configuration, but change the arguments of the controller action. Instead of ``string $slug``, add ``BlogPost $post``:: @@ -998,10 +971,6 @@ database queries used to fetch the object from the route parameter. Backed Enum Parameters ~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.3 - - The support of ``\BackedEnum`` as route parameters was introduced Symfony 6.3. - You can use PHP `backed enumerations`_ as route parameters because Symfony will convert them automatically to their scalar values. @@ -1622,13 +1591,6 @@ the current route and its attributes: {% set route_name = app.current_route %} {% set route_parameters = app.current_route_parameters %} -.. versionadded:: 6.2 - - The ``app.current_route`` and ``app.current_route_parameters`` variables - were introduced in Symfony 6.2. - Before you had to access ``_route`` and ``_route_params`` request - attributes using ``app.request.attributes.get()``. - Special Routes -------------- diff --git a/routing/custom_route_loader.rst b/routing/custom_route_loader.rst index d02e6b31519..0cea7d6b9fd 100644 --- a/routing/custom_route_loader.rst +++ b/routing/custom_route_loader.rst @@ -108,15 +108,6 @@ Symfony provides several route loaders for the most common needs: $routes->import('@AcmeOtherBundle/Resources/config/routing/', 'directory'); }; -.. versionadded:: 6.1 - - The ``attribute`` value of the second argument of ``import()`` was introduced - in Symfony 6.1. - -.. versionadded:: 6.2 - - The feature to import routes from a PSR-4 namespace root was introduced in Symfony 6.2. - .. note:: When importing resources, the key (e.g. ``app_file``) is the name of the collection. diff --git a/security.rst b/security.rst index 7285a6b77b4..9e40924cae3 100644 --- a/security.rst +++ b/security.rst @@ -468,12 +468,6 @@ You can also manually hash a password by running: Read more about all available hashers and password migration in :doc:`security/passwords`. -.. versionadded:: 6.2 - - In applications using Symfony 6.2 and PHP 8.2 or newer, the - `SensitiveParameter PHP attribute`_ is applied to all plain passwords and - sensitive tokens so they don't appear in stack traces. - .. _firewalls-authentication: .. _a-authentication-firewalls: @@ -612,10 +606,6 @@ don't accidentally block Symfony's dev tools - which live under URLs like This feature is not supported by the XML configuration format. - .. versionadded:: 6.4 - - The feature to use an array of regex was introduced in Symfony 6.4. - All *real* URLs are handled by the ``main`` firewall (no ``pattern`` key means it matches *all* URLs). A firewall can have many modes of authentication, in other words, it enables many ways to ask the question "Who are you?". @@ -680,10 +670,6 @@ use the :class:`Symfony\\Bundle\\SecurityBundle\\Security` service:: } } -.. versionadded:: 6.2 - - The ``getFirewallConfig()`` method was introduced in Symfony 6.2. - .. _security-authenticators: Authenticating Users @@ -1717,17 +1703,6 @@ for more information about this. Login Programmatically ---------------------- -.. versionadded:: 6.2 - - The :class:`Symfony\Bundle\SecurityBundle\Security ` - class was introduced in Symfony 6.2. Prior to 6.2, it was called - ``Symfony\Component\Security\Core\Security``. - -.. versionadded:: 6.2 - - The :method:`Symfony\\Bundle\\SecurityBundle\\Security::login` - method was introduced in Symfony 6.2. - You can log in a user programmatically using the ``login()`` method of the :class:`Symfony\\Bundle\\SecurityBundle\\Security` helper:: @@ -1769,14 +1744,6 @@ You can log in a user programmatically using the ``login()`` method of the } } -.. versionadded:: 6.3 - - The feature to use a custom redirection logic was introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The feature to add badges was introduced in Symfony 6.4. - .. _security-logging-out: Logging Out @@ -1904,17 +1871,6 @@ Symfony will un-authenticate the current user and redirect them. Logout programmatically ~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.2 - - The :class:`Symfony\Bundle\SecurityBundle\Security ` - class was introduced in Symfony 6.2. Prior to 6.2, it was called - ``Symfony\Component\Security\Core\Security``. - -.. versionadded:: 6.2 - - The :method:`Symfony\\Bundle\\SecurityBundle\\Security::logout` - method was introduced in Symfony 6.2. - You can logout user programmatically using the ``logout()`` method of the :class:`Symfony\\Bundle\\SecurityBundle\\Security` helper:: @@ -2049,12 +2005,6 @@ If you need to get the logged in user from a service, use the } } -.. versionadded:: 6.2 - - The :class:`Symfony\\Bundle\\SecurityBundle\\Security` class - was introduced in Symfony 6.2. In previous Symfony versions this class was - defined in ``Symfony\Component\Security\Core\Security``. - Fetch the User in a Template ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2454,15 +2404,6 @@ that is thrown with the ``exceptionCode`` argument:: // ... } -.. versionadded:: 6.2 - - The ``#[IsGranted()]`` attribute was introduced in Symfony 6.2. - -.. versionadded:: 6.3 - - The ``exceptionCode`` argument of the ``#[IsGranted()]`` attribute was - introduced in Symfony 6.3. - .. _security-template: Access Control in Templates @@ -2896,4 +2837,3 @@ Authorization (Denying Access) .. _`HTTP Basic authentication`: https://en.wikipedia.org/wiki/Basic_access_authentication .. _`Login CSRF attacks`: https://en.wikipedia.org/wiki/Cross-site_request_forgery#Forging_login_requests .. _`PHP date relative formats`: https://www.php.net/manual/en/datetime.formats.php#datetime.formats.relative -.. _`SensitiveParameter PHP attribute`: https://www.php.net/manual/en/class.sensitiveparameter.php diff --git a/security/access_control.rst b/security/access_control.rst index abba217702f..4fd19925e85 100644 --- a/security/access_control.rst +++ b/security/access_control.rst @@ -33,14 +33,6 @@ options are used for matching: * ``attributes``: an array, which can be used to specify one or more :ref:`request attributes ` that must match exactly * ``route``: a route name -.. versionadded:: 6.1 - - The ``request_matcher`` option was introduced in Symfony 6.1. - -.. versionadded:: 6.2 - - The ``route`` and ``attributes`` options were introduced in Symfony 6.2. - Take the following ``access_control`` entries as an example: .. configuration-block:: diff --git a/security/access_token.rst b/security/access_token.rst index b689949c71a..48ff8629fa1 100644 --- a/security/access_token.rst +++ b/security/access_token.rst @@ -352,10 +352,6 @@ an authorization server. 1) Configure the OidcUserInfoTokenHandler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.3 - - The ``OidcUserInfoTokenHandler`` class was introduced in Symfony 6.3. - The ``OidcUserInfoTokenHandler`` requires the ``symfony/http-client`` package to make the needed HTTP requests. If you haven't installed it yet, run this command: @@ -539,10 +535,6 @@ claims. To create your own user object from the claims, you must 2) Configure the OidcTokenHandler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.3 - - The ``OidcTokenHandler`` class was introduced in Symfony 6.3. - The ``OidcTokenHandler`` requires ``web-token/jwt-signature``, ``web-token/jwt-checker`` and ``web-token/jwt-signature-algorithm-ecdsa`` packages. If you haven't installed them yet, run these commands: diff --git a/security/expressions.rst b/security/expressions.rst index e3e6425f6d5..cf7071e79a9 100644 --- a/security/expressions.rst +++ b/security/expressions.rst @@ -69,10 +69,6 @@ and ``#[IsGranted()]`` attribute also accept an } } -.. versionadded:: 6.2 - - The ``#[IsGranted()]`` attribute was introduced in Symfony 6.2. - In this example, if the current user has ``ROLE_ADMIN`` or if the current user object's ``isSuperAdmin()`` method returns ``true``, then access will be granted (note: your User object may not have an ``isSuperAdmin()`` method, diff --git a/security/impersonating_user.rst b/security/impersonating_user.rst index b801b5570c1..8bc36c98c76 100644 --- a/security/impersonating_user.rst +++ b/security/impersonating_user.rst @@ -242,10 +242,6 @@ also adjust the query parameter name via the ``parameter`` setting: Redirecting to a Specific Target Route -------------------------------------- -.. versionadded:: 6.2 - - The ``target_route`` configuration option was introduced in Symfony 6.2. - .. note:: It works only in a stateful firewall. diff --git a/security/login_link.rst b/security/login_link.rst index 2af87ab4ded..041d59a1e1c 100644 --- a/security/login_link.rst +++ b/security/login_link.rst @@ -808,7 +808,3 @@ but you can change the lifetime per link using the third argument of the // the third optional argument is the lifetime in seconds $loginLinkDetails = $loginLinkHandler->createLoginLink($user, null, 60); $loginLink = $loginLinkDetails->getUrl(); - -.. versionadded:: 6.2 - - The argument to customize the link lifetime was introduced in Symfony 6.2. diff --git a/security/remember_me.rst b/security/remember_me.rst index e2b087fa249..6d1e82e8c69 100644 --- a/security/remember_me.rst +++ b/security/remember_me.rst @@ -152,10 +152,6 @@ you can add a ``_remember_me`` key to the body of your POST request. Optionally, you can configure a custom name for this key using the ``name`` setting under the ``remember_me`` section of your firewall. -.. versionadded:: 6.3 - - The JSON login ``_remember_me`` option was introduced in Symfony 6.3. - Always activating Remember Me ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/security/user_checkers.rst b/security/user_checkers.rst index 99cdfe04076..d62cc0bea32 100644 --- a/security/user_checkers.rst +++ b/security/user_checkers.rst @@ -117,10 +117,6 @@ is the service id of your user checker: Using Multiple User Checkers ---------------------------- -.. versionadded:: 6.2 - - The ``ChainUserChecker`` class was added in Symfony 6.2. - It is common for applications to have multiple authentication entry points (such as traditional form based login and an API) which may have unique checker rules for each entry point as well as common rules for all entry points. To allow using multiple user diff --git a/security/voters.rst b/security/voters.rst index 7d37aea2510..0aefd3c2aa8 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -126,10 +126,6 @@ calls out to the "voter" system. Right now, no voters will vote on whether or no the user can "view" or "edit" a ``Post``. But you can create your *own* voter that decides this using whatever logic you want. -.. versionadded:: 6.2 - - The ``#[IsGranted()]`` attribute was introduced in Symfony 6.2. - Creating the custom Voter ------------------------- diff --git a/serializer.rst b/serializer.rst index daa898dbb7b..ef155a1a45d 100644 --- a/serializer.rst +++ b/serializer.rst @@ -157,10 +157,6 @@ configuration: ; }; -.. versionadded:: 6.2 - - The option to configure YAML indentation was introduced in Symfony 6.2. - You can also specify the context on a per-property basis:: .. configuration-block:: @@ -267,19 +263,11 @@ all the properties of the class:: // ... } -.. versionadded:: 6.4 - - The ``#[Context]`` attribute was introduced in Symfony 6.4. - .. _serializer-using-context-builders: Using Context Builders ---------------------- -.. versionadded:: 6.1 - - Context builders were introduced in Symfony 6.1. - To define the (de)serialization context, you can use "context builders", which are objects that help you to create that context by providing autocompletion, validation, and documentation:: @@ -369,11 +357,6 @@ In this example, the ``id`` and the ``name`` properties belong to the ``show_product`` and ``list_product`` groups. The ``description`` property only belongs to the ``show_product`` group. -.. versionadded:: 6.4 - - The support of the ``#[Groups]`` attribute on class level was - introduced in Symfony 6.4. - Now that your groups are defined, you can choose which groups to use when serializing:: @@ -444,10 +427,6 @@ their paths using a :doc:`valid PropertyAccess syntax -.. versionadded:: 6.2 - - The option to configure a ``SerializedPath`` was introduced in Symfony 6.2. - Using the configuration from above, denormalizing with a metadata-aware normalizer will write the ``birthday`` field from ``$data`` onto the ``Person`` object:: @@ -551,11 +530,6 @@ given class: | | ] | +----------+------------------------------------------------------------+ -.. versionadded:: 6.3 - - The debug:serializer`` command was introduced in Symfony 6.3. - - Going Further with the Serializer --------------------------------- diff --git a/serializer/custom_context_builders.rst b/serializer/custom_context_builders.rst index b40e432286d..a326fcfc2d6 100644 --- a/serializer/custom_context_builders.rst +++ b/serializer/custom_context_builders.rst @@ -1,10 +1,6 @@ How to Create your Custom Context Builder ========================================= -.. versionadded:: 6.1 - - Context builders were introduced in Symfony 6.1. - The :doc:`Serializer Component ` uses Normalizers and Encoders to transform any data to any data-structure (e.g. JSON). That serialization process can be configured thanks to a diff --git a/service_container.rst b/service_container.rst index c3e5c0b6860..47a60f37512 100644 --- a/service_container.rst +++ b/service_container.rst @@ -816,10 +816,6 @@ Our configuration looks like this: Closures can be injected :ref:`by using autowiring ` and its dedicated attributes. -.. versionadded:: 6.1 - - The ``closure`` argument type was introduced in Symfony 6.1. - .. _services-binding: Binding Arguments by Name or Type @@ -1168,11 +1164,6 @@ key. For example, the default Symfony configuration contains this: may use the :class:`Symfony\\Component\\DependencyInjection\\Attribute\\Exclude` attribute directly on your class to exclude it. - .. versionadded:: 6.3 - - The :class:`Symfony\\Component\\DependencyInjection\\Attribute\\Exclude` - attribute was introduced in Symfony 6.3. - This can be used to quickly make many classes available as services and apply some default configuration. The ``id`` of each service is its fully-qualified class name. You can override any service that's imported by using its id (class name) below @@ -1451,11 +1442,6 @@ Thanks to the ``#[AutowireCallable]`` attribute, you can now inject this } } -.. versionadded:: 6.3 - - The :class:`Symfony\\Component\\DependencyInjection\\Attribute\\AutowireCallable` - attribute was introduced in Symfony 6.3. - Instead of using the ``#[AutowireCallable]`` attribute, you can also generate an adapter for a functional interface through configuration: diff --git a/service_container/alias_private.rst b/service_container/alias_private.rst index 7a7eef2a458..b74acb99d8e 100644 --- a/service_container/alias_private.rst +++ b/service_container/alias_private.rst @@ -150,10 +150,6 @@ services. $services->alias('app.mailer', PhpMailer::class); }; -.. versionadded:: 6.3 - - The ``#[AsAlias]`` attribute was introduced in Symfony 6.3. - This means that when using the container directly, you can access the ``PhpMailer`` service by asking for the ``app.mailer`` service like this:: diff --git a/service_container/autowiring.rst b/service_container/autowiring.rst index daa1e96328b..898ccdd100b 100644 --- a/service_container/autowiring.rst +++ b/service_container/autowiring.rst @@ -611,10 +611,6 @@ logic about those arguments:: } } -.. versionadded:: 6.1 - - The ``#[Autowire]`` attribute was introduced in Symfony 6.1. - The ``#[Autowire]`` attribute can also be used for :ref:`parameters `, :doc:`complex expressions ` and even :ref:`environment variables `:: @@ -648,10 +644,6 @@ The ``#[Autowire]`` attribute can also be used for :ref:`parameters `). - -.. versionadded:: 6.1 - - Using expressions in ``factories`` was introduced in Symfony 6.1. diff --git a/service_container/factories.rst b/service_container/factories.rst index a917a661afa..d4357cfd58a 100644 --- a/service_container/factories.rst +++ b/service_container/factories.rst @@ -231,10 +231,6 @@ as the factory class: ->constructor('create'); }; -.. versionadded:: 6.3 - - The ``constructor`` option was introduced in Symfony 6.3. - Non-Static Factories -------------------- @@ -377,10 +373,6 @@ method name: Using Expressions in Service Factories -------------------------------------- -.. versionadded:: 6.1 - - Using expressions as factories was introduced in Symfony 6.1. - Instead of using PHP classes as a factory, you can also use :doc:`expressions `. This allows you to e.g. change the service based on a parameter: diff --git a/service_container/lazy_services.rst b/service_container/lazy_services.rst index 905c4b3a599..46e939d4fac 100644 --- a/service_container/lazy_services.rst +++ b/service_container/lazy_services.rst @@ -29,11 +29,6 @@ until you interact with the proxy in some way. In PHP versions prior to 8.0 lazy services do not support parameters with default values for built-in PHP classes (e.g. ``PDO``). -.. versionadded:: 6.2 - - Starting from Symfony 6.2, service laziness is supported out of the box - without having to install any additional package. - .. _lazy-services_configuration: Configuration @@ -129,11 +124,6 @@ laziness, and supports lazy-autowiring of intersection types:: ) { } -.. versionadded:: 6.3 - - The ``lazy`` argument of the ``#[Autowire()]`` attribute was introduced in - Symfony 6.3. - Interface Proxifying -------------------- diff --git a/service_container/service_decoration.rst b/service_container/service_decoration.rst index 0262ae03e7e..ce33207e568 100644 --- a/service_container/service_decoration.rst +++ b/service_container/service_decoration.rst @@ -123,10 +123,6 @@ but keeps a reference of the old one as ``.inner``: ->decorate(Mailer::class); }; -.. versionadded:: 6.1 - - The ``#[AsDecorator]`` attribute was introduced in Symfony 6.1. - The ``decorates`` option tells the container that the ``App\DecoratingMailer`` service replaces the ``App\Mailer`` service. If you're using the :ref:`default services.yaml configuration `, diff --git a/service_container/service_subscribers_locators.rst b/service_container/service_subscribers_locators.rst index a39ccfb4a68..a4aa426bc59 100644 --- a/service_container/service_subscribers_locators.rst +++ b/service_container/service_subscribers_locators.rst @@ -247,10 +247,6 @@ service type to a service. Add Dependency Injection Attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.2 - - The ability to add attributes was introduced in Symfony 6.2. - As an alternate to aliasing services in your configuration, you can also configure the following dependency injection attributes in the ``getSubscribedServices()`` method directly: @@ -375,12 +371,6 @@ attribute:: } } -.. versionadded:: 6.4 - - The - :class:`Symfony\\Component\\DependencyInjection\\Attribute\\AutowireLocator` - attribute was introduced in Symfony 6.4. - .. note:: To receive an iterable instead of a service locator, you can switch the @@ -389,12 +379,6 @@ attribute:: :class:`Symfony\\Component\\DependencyInjection\\Attribute\\AutowireIterator` attribute. - .. versionadded:: 6.4 - - The - :class:`Symfony\\Component\\DependencyInjection\\Attribute\\AutowireIterator` - attribute was introduced in Symfony 6.4. - .. _service-subscribers-locators_defining-service-locator: Defining a Service Locator @@ -939,10 +923,6 @@ and compose your services with them:: ``SubscribedService`` Attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.2 - - The ability to add attributes was introduced in Symfony 6.2. - You can use the ``attributes`` argument of ``SubscribedService`` to add any of the following dependency injection attributes: diff --git a/service_container/tags.rst b/service_container/tags.rst index 4955016d5a0..5021ec3d8d5 100644 --- a/service_container/tags.rst +++ b/service_container/tags.rst @@ -550,10 +550,6 @@ To answer this, change the service declaration: ; }; -.. versionadded:: 6.2 - - Support for attributes as array was introduced in Symfony 6.2. - .. tip:: The ``name`` attribute is used by default to define the name of the tag. @@ -847,15 +843,6 @@ iterator, add the ``exclude`` option: In the case the referencing service is itself tagged with the tag being used in the tagged iterator, it is automatically excluded from the injected iterable. -.. versionadded:: 6.1 - - The ``exclude`` option was introduced in Symfony 6.1. - -.. versionadded:: 6.3 - - The automatic exclusion of the referencing service in the injected iterable was - introduced in Symfony 6.3. - .. seealso:: See also :doc:`tagged locator services ` diff --git a/templates.rst b/templates.rst index a8f066e83be..53edd5b89d8 100644 --- a/templates.rst +++ b/templates.rst @@ -385,19 +385,6 @@ gives you access to these variables: ``app.enabled_locales`` The locales enabled in the application. -.. versionadded:: 6.2 - - The ``app.current_route`` and ``app.current_route_parameters`` variables - were introduced in Symfony 6.2. - -.. versionadded:: 6.3 - - The ``app.locale`` variable was introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The ``app.enabled_locales`` variable was introduced in Symfony 6.4. - In addition to the global ``app`` variable injected by Symfony, you can also inject variables automatically to all Twig templates as explained in the next section. @@ -606,10 +593,6 @@ to define the template to render:: } } -.. versionadded:: 6.2 - - The ``#[Template()]`` attribute was introduced in Symfony 6.2. - The :ref:`base AbstractController ` also provides the :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController::renderBlock` and :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController::renderBlockView` @@ -649,13 +632,6 @@ This might come handy when dealing with blocks in :ref:`templates inheritance ` or when using `Turbo Streams`_. -.. versionadded:: 6.4 - - The - :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController::renderBlock` and - :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController::renderBlockView` - methods were introduced in Symfony 6.4. - Rendering a Template in Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -907,10 +883,6 @@ depending on your needs: {% endfor %} -.. versionadded:: 6.3 - - The option to use named arguments in ``dump()`` was introduced in Symfony 6.3. - To avoid leaking sensitive information, the ``dump()`` function/tag is only available in the ``dev`` and ``test`` :ref:`configuration environments `. If you try to use it in the ``prod`` environment, you will see a PHP error. diff --git a/testing.rst b/testing.rst index 6c61531e4ed..e5347efa841 100644 --- a/testing.rst +++ b/testing.rst @@ -320,11 +320,6 @@ concrete one:: No further configuration in required, as the test service container is a special one that allows you to interact with private services and aliases. -.. versionadded:: 6.3 - - The possibility to set a private service with the test service container - without declaring a public alias for it was introduced in Symfony 6.3. - .. _testing-databases: Configuring a Database for Tests @@ -726,12 +721,6 @@ attributes in this token, you can use the ``tokenAttributes`` argument of the By design, the ``loginUser()`` method doesn't work when using stateless firewalls. Instead, add the appropriate token/header in each ``request()`` call. -.. versionadded:: 6.4 - - The ``tokenAttributes`` argument of the - :method:`Symfony\\Bundle\\FrameworkBundle\\KernelBrowser::loginUser` method - was introduced in Symfony 6.4. - Making AJAX Requests .................... @@ -997,11 +986,6 @@ Response Assertions ``assertResponseIsUnprocessable(string $message = '')`` Asserts the response is unprocessable (HTTP status is 422) -.. versionadded:: 6.4 - - The support for relative path in ``assertResponseRedirects()`` was introduced - in Symfony 6.4. - Request Assertions .................. @@ -1063,15 +1047,6 @@ Crawler Assertions Asserts that value of the field of the first form matching the given selector does (not) equal the expected value. -.. versionadded:: 6.3 - - The ``assertSelectorCount()`` method was introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The ``assertAnySelectorTextContains()``, ``assertAnySelectorTextNotContains()`` - and ``assertAnySelectorTextSame()`` were introduced in Symfony 6.4. - .. _mailer-assertions: Mailer Assertions @@ -1109,11 +1084,6 @@ Mailer Assertions Asserts that the subject of the given email does (not) contain the expected subject. -.. versionadded:: 6.4 - - The ``assertEmailSubjectContains()`` and ``assertEmailSubjectNotContains()`` - assertions were introduced in Symfony 6.4. - Notifier Assertions ................... @@ -1140,10 +1110,6 @@ Notifier Assertions Asserts that the name of the transport for the given notification is not the same as the given text. -.. versionadded:: 6.2 - - The Notifier assertions were introduced in Symfony 6.2. - HttpClient Assertions ..................... @@ -1167,10 +1133,6 @@ HttpClient Assertions By default it will check on the HttpClient, but you can also pass a specific HttpClient ID. -.. versionadded:: 6.4 - - The HttpClient assertions were introduced in Symfony 6.4. - .. TODO .. End to End Tests (E2E) .. ---------------------- diff --git a/translation.rst b/translation.rst index 07f7cbde570..306b3186ad0 100644 --- a/translation.rst +++ b/translation.rst @@ -451,11 +451,6 @@ The ``translation:extract`` command looks for missing translations in: * Any PHP file/class stored in the ``src/`` directory that uses :ref:`Constraints Attributes ` with ``*message`` named argument(s). -.. versionadded:: 6.2 - - The support of PHP files/classes that use constraint attributes was - introduced in Symfony 6.2. - .. _translation-resource-locations: Translation Resource/File Names and Locations @@ -499,10 +494,6 @@ provides many loaders which are selected based on the following file extensions: * ``.po``: `Portable object format`_; * ``.qt``: `QT Translations TS XML`_ file; -.. versionadded:: 6.1 - - The ``.xliff`` file extension support was introduced in Symfony 6.1. - The choice of which loader to use is entirely up to you and is a matter of taste. The recommended option is to use YAML for simple projects and use XLIFF if you're generating translations with specialized programs or teams. @@ -607,10 +598,6 @@ Lokalise ``composer require symfony/lokalise-translation-provider`` Phrase ``composer require symfony/phrase-translation-provider`` ==================== =========================================================== -.. versionadded:: 6.4 - - The ``Phrase`` translation provider was introduced in Symfony 6.4. - Each library includes a :ref:`Symfony Flex recipe ` that will add a configuration example to your ``.env`` file. For example, suppose you want to use Loco. First, install it: @@ -766,11 +753,6 @@ now use the following commands to push (upload) and pull (download) translations # of flat keys $ php bin/console translation:pull loco --force --as-tree -.. versionadded:: 6.4 - - The ``--as-tree`` option of the ``translation:pull`` command was introduced - in Symfony 6.4. - Creating Custom Providers ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1043,10 +1025,6 @@ checks translation resources for several locales: Switch Locale Programmatically ------------------------------ -.. versionadded:: 6.1 - - The ``LocaleSwitcher`` was introduced in Symfony 6.1. - Sometimes you need to change the locale of the application dynamically just to run some code. Imagine a console command that renders Twig templates of emails in different languages. You need to change the locale only to @@ -1103,13 +1081,6 @@ of: } } -.. versionadded:: 6.4 - - The support of declaring an argument in the callback to inject the locale - being used in the - :method:`Symfony\\Component\\Translation\\LocaleSwitcher::runWithLocale` - method was introduced in Symfony 6.4. - When using :ref:`autowiring `, type-hint any controller or service argument with the :class:`Symfony\\Component\\Translation\\LocaleSwitcher` class to inject the locale switcher service. Otherwise, configure your services diff --git a/validation.rst b/validation.rst index af98a7ff852..39922038c9b 100644 --- a/validation.rst +++ b/validation.rst @@ -203,10 +203,6 @@ Inside the template, you can output the list of errors exactly as needed: object allows you, among other things, to get the constraint that caused this violation thanks to the ``ConstraintViolation::getConstraint()`` method. -.. versionadded:: 6.3 - - The ``ConstraintViolation::getConstraint()`` method was introduced in Symfony 6.3. - Validation Callables ~~~~~~~~~~~~~~~~~~~~ diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index 7506cd84f2c..7ea504f0842 100644 --- a/validation/custom_constraint.rst +++ b/validation/custom_constraint.rst @@ -39,10 +39,6 @@ First you need to create a Constraint class and extend :class:`Symfony\\Componen Add ``#[\Attribute]`` to the constraint class if you want to use it as an attribute in other classes. -.. versionadded:: 6.1 - - The ``#[HasNamedArguments]`` attribute was introduced in Symfony 6.1. - You can use ``#[HasNamedArguments]`` to make some constraint options required:: // src/Validator/ContainsAlphanumeric.php diff --git a/workflow.rst b/workflow.rst index 2e17b40794c..b1ec43c8199 100644 --- a/workflow.rst +++ b/workflow.rst @@ -168,11 +168,6 @@ follows: ``'draft'`` or ``!php/const App\Entity\BlogPost::TRANSITION_TO_REVIEW`` instead of ``'to_review'``. -.. versionadded:: 6.4 - - Since Symfony 6.4, the ``type`` option under ``marking_store`` can be - omitted when the ``property`` option is explicitly set. - The configured property will be used via its implemented getter/setter methods by the marking store:: // src/Entity/BlogPost.php @@ -231,11 +226,6 @@ you must declare a setter to write your property:: } } -.. versionadded:: 6.4 - - The feature to use public properties instead of getter/setter methods - and private properties was introduced in Symfony 6.4. - .. note:: The marking store type could be "multiple_state" or "single_state". A single @@ -342,16 +332,6 @@ attribute:: This allows you to decorrelate the argument name of any implementation name. -.. versionadded:: 6.2 - - All workflows and state machines services are tagged since in Symfony 6.2. - -.. versionadded:: 6.3 - - Injecting a workflow with only its name and - :class:`Symfony\\Component\\DependencyInjection\\Attribute\\Target` was - introduced in Symfony 6.3. - .. tip:: If you want to retrieve all workflows, for documentation purposes for example, @@ -548,10 +528,6 @@ You may refer to the documentation about :ref:`defining event listeners with PHP attributes ` for further use. -.. versionadded:: 6.4 - - The workflow event attributes were introduced in Symfony 6.4. - .. _workflow-usage-guard-events: Guard Events diff --git a/workflow/workflow-and-state-machine.rst b/workflow/workflow-and-state-machine.rst index f6b93fa693c..eabb8d2a28e 100644 --- a/workflow/workflow-and-state-machine.rst +++ b/workflow/workflow-and-state-machine.rst @@ -283,10 +283,6 @@ machine type, use ``camelCased workflow name + StateMachine``:: } -.. versionadded:: 6.2 - - All workflows and state machines services are tagged since in Symfony 6.2. - Automatic and Manual Validation ------------------------------- From 93a0effe629e49efce25f98f917d4119269b211f Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 22 Oct 2023 11:49:53 +0200 Subject: [PATCH 38/99] remove Symfony 6 versionadded directives --- components/finder.rst | 4 ---- components/http_foundation.rst | 6 ------ html_sanitizer.rst | 5 ----- messenger.rst | 8 -------- reference/dic_tags.rst | 6 ------ 5 files changed, 29 deletions(-) diff --git a/components/finder.rst b/components/finder.rst index 6a76c73ac08..516db7cde4e 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -337,10 +337,6 @@ using a closure, return ``false`` for the directories which you want to prune. Pruning directories early can improve performance significantly depending on the file/directory hierarchy complexity and the number of excluded directories. -.. versionadded:: 6.4 - - The feature to prune directories was introduced in Symfony 6.4. - Sorting Results --------------- diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 70060b93127..475d222dab5 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -478,12 +478,6 @@ your application to see which exceptions are thrown in listeners of the more about it in :ref:`the dedicated section about Kernel events `. -.. versionadded:: 6.4 - - The ``$flush`` parameter of the - :method:`Symfony\\Component\\HttpFoundation\\Response::send` method - was introduced in Symfony 6.4. - Setting Cookies ~~~~~~~~~~~~~~~ diff --git a/html_sanitizer.rst b/html_sanitizer.rst index 6dd9b7771cf..6a5195880c2 100644 --- a/html_sanitizer.rst +++ b/html_sanitizer.rst @@ -1008,11 +1008,6 @@ increase or decrease this limit: It is possible to disable this length limit by setting the max input length to ``-1``. Beware that it may expose your application to `DoS attacks`_. -.. versionadded:: 6.4 - - The support for disabling the length limit of the HTML sanitizer was - introduced in Symfony 6.4. - Custom Attribute Sanitizers ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/messenger.rst b/messenger.rst index 3ee8b0dc6eb..9c8e8202afa 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1768,14 +1768,6 @@ The transport has a number of options: You can learn more about middlewares in :ref:`the dedicated section `. - .. versionadded:: 6.4 - - The - :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Middleware\\AddFifoStampMiddleware`, - :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageDeduplicationAwareInterface` - and :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageGroupAwareInterface` - were introduced in Symfony 6.4. - FIFO queues don't support setting a delay per message, a value of ``delay: 0`` is required in the retry strategy settings. diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 8ffc5eb1b18..94f18efc990 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -512,12 +512,6 @@ If you don't need to preload anything, return an empty array. If read-only artefacts need to be created, you can store them in a different directory with the ``$buildDir`` parameter of the ``warmUp()`` method. -.. versionadded:: 6.4 - - The ``$buildDir`` parameter of the - :method:`Symfony\\Component\\HttpKernel\\CacheWarmer\\WarmableInterface::warmUp` - method was introduced in Symfony 6.4. - The ``isOptional()`` method should return true if it's possible to use the application without calling this cache warmer. In Symfony, optional warmers are always executed by default (you can change this by using the From bba62162998fb7ef03a37e22b47f2f229fe880ff Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 24 Oct 2023 10:31:55 +0200 Subject: [PATCH 39/99] Remove obsolete versionadded directives --- frontend/asset_mapper.rst | 6 ------ reference/configuration/kernel.rst | 16 ---------------- 2 files changed, 22 deletions(-) diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index 140c4d22c88..150c57ff05f 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -961,12 +961,6 @@ the polyfill loading. $ php bin/console importmap:require es-module-shims -.. versionadded:: 6.4 - - Passing an importmap name in ``importmap_polyfill`` was - introduced in Symfony 6.4. Prior to this, you could pass ``false`` - or a custom URL to load the polyfill. - ``framework.asset_mapper.importmap_script_attributes`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/reference/configuration/kernel.rst b/reference/configuration/kernel.rst index cbfb48f1316..813cd41223c 100644 --- a/reference/configuration/kernel.rst +++ b/reference/configuration/kernel.rst @@ -314,10 +314,6 @@ the application is running in web mode and ``web=1&worker=1`` when running in a long-running web server. This parameter can be set by using the ``APP_RUNTIME_MODE`` env var. -.. versionadded:: 6.4 - - The ``kernel.runtime_mode`` parameter was introduced in Symfony 6.4. - ``kernel.runtime_mode.web`` --------------------------- @@ -325,10 +321,6 @@ a long-running web server. This parameter can be set by using the Whether the application is running in a web environment. -.. versionadded:: 6.4 - - The ``kernel.runtime_mode.web`` parameter was introduced in Symfony 6.4. - ``kernel.runtime_mode.cli`` --------------------------- @@ -337,10 +329,6 @@ Whether the application is running in a web environment. Whether the application is running in a CLI environment. By default, this value is the opposite of the ``kernel.runtime_mode.web`` parameter. -.. versionadded:: 6.4 - - The ``kernel.runtime_mode.cli`` parameter was introduced in Symfony 6.4. - ``kernel.runtime_mode.worker`` ------------------------------ @@ -349,10 +337,6 @@ this value is the opposite of the ``kernel.runtime_mode.web`` parameter. Whether the application is running in a worker/long-running environment. Not all web servers support it, and you have to use a long-running web server like `FrankenPHP`_. -.. versionadded:: 6.4 - - The ``kernel.runtime_mode.worker`` parameter was introduced in Symfony 6.4. - ``kernel.secret`` ----------------- From 4fd16133498febb9cf9dfb8d2550bcb566f5fc08 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 24 Oct 2023 11:23:29 +0200 Subject: [PATCH 40/99] [PropertyInfo][Serializer] Remove `AnnotationLoader` --- _build/redirection_map | 1 + components/property_info.rst | 14 -------------- components/serializer.rst | 24 ------------------------ 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/_build/redirection_map b/_build/redirection_map index 90303a53d75..3b845d59ffe 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -526,6 +526,7 @@ /components https://symfony.com/components /components/index https://symfony.com/components /serializer/normalizers /components/serializer#normalizers +/components/serializer#component-serializer-attributes-groups-annotations /components/serializer#component-serializer-attributes-groups-attributes /logging/monolog_regex_based_excludes /logging/monolog_exclude_http_codes /security/named_encoders /security/named_hashers /components/inflector /components/string#inflector diff --git a/components/property_info.rst b/components/property_info.rst index 0e8a4671d81..452966f57d5 100644 --- a/components/property_info.rst +++ b/components/property_info.rst @@ -468,20 +468,6 @@ with the ``property_info`` service in the Symfony Framework:: // the `serializer_groups` option must be configured (may be set to null) $serializerExtractor->getProperties($class, ['serializer_groups' => ['mygroup']]); -.. versionadded:: 6.4 - - The - :class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AttributeLoader` - was introduced in Symfony 6.4. Prior to this, the - :class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader` - must be used. - -.. deprecated:: 6.4 - - The - :class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader` - was deprecated in Symfony 6.4. - If ``serializer_groups`` is set to ``null``, serializer groups metadata won't be checked but you will get only the properties considered by the Serializer Component (notably the ``#[Ignore]`` attribute is taken into account). diff --git a/components/serializer.rst b/components/serializer.rst index 9282cfec115..ba2c4a45a4d 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -271,14 +271,6 @@ that will be used by the normalizer must be aware of the format to use. The following code shows how to initialize the :class:`Symfony\\Component\\Serializer\\Mapping\\Factory\\ClassMetadataFactory` for each format: -* Annotations in PHP files:: - - use Doctrine\Common\Annotations\AnnotationReader; - use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; - use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader; - - $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())); - * Attributes in PHP files:: use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; @@ -300,22 +292,6 @@ for each format: $classMetadataFactory = new ClassMetadataFactory(new XmlFileLoader('/path/to/your/definition.xml')); -.. versionadded:: 6.4 - - The - :class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AttributeLoader` - was introduced in Symfony 6.4. Prior to this, the - :class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader` - must be used. - -.. deprecated:: 6.4 - - Reading annotations in PHP files is deprecated since Symfony 6.4. - Also, the - :class:`Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader` - was deprecated in Symfony 6.4. - -.. _component-serializer-attributes-groups-annotations: .. _component-serializer-attributes-groups-attributes: Then, create your groups definition: From 8510eb4be782212c1be9652f7b1c2c0a21aa3e9f Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 28 Oct 2023 12:38:55 +0200 Subject: [PATCH 41/99] remove versionadded directive for Symfony 6.4 --- components/phpunit_bridge.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 44e7d40bb69..f1c81a5769e 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -428,11 +428,6 @@ configuration file: -.. versionadded:: 6.4 - - The support for the ``SYMFONY_PHPUNIT_LOCALE`` environment variable was - introduced in Symfony 6.4. - .. _write-assertions-about-deprecations: Write Assertions about Deprecations From 2a70cd2819f8a089702cd74b017635fee5de6932 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Mon, 30 Oct 2023 10:58:07 +0100 Subject: [PATCH 42/99] - --- security/impersonating_user.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/security/impersonating_user.rst b/security/impersonating_user.rst index 6b1a57b2eca..22c6ba11c73 100644 --- a/security/impersonating_user.rst +++ b/security/impersonating_user.rst @@ -74,10 +74,6 @@ as the value to the current URL: You can leverage the Twig function ``impersonation_path('thomas')`` - .. versionadded:: 6.4 - - The ``impersonation_path()`` function was introduced in Symfony 6.4. - .. tip:: Instead of adding a ``_switch_user`` query string parameter, you can pass From 7349989b9bb413653def0fda189e057845fdc081 Mon Sep 17 00:00:00 2001 From: Antoine Lamirault Date: Sun, 19 Nov 2023 15:01:25 +0100 Subject: [PATCH 43/99] [String] New locale aware casing methods --- components/string.rst | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/components/string.rst b/components/string.rst index f743849fd19..ba73e7387b6 100644 --- a/components/string.rst +++ b/components/string.rst @@ -203,7 +203,10 @@ Methods to Change Case :: // changes all graphemes/code points to lower case - u('FOO Bar')->lower(); // 'foo bar' + u('FOO Bar BrΔ°an')->lower(); // 'foo bar briΜ‡an' + // changes all graphemes/code points to lower case according to locale-specific case mappings + u('FOO Bar BrΔ°an')->localeLower('en'); // 'foo bar briΜ‡an' + u('FOO Bar BrΔ°an')->localeLower('lt'); // 'foo bar briΜ‡Μ‡an' // when dealing with different languages, uppercase/lowercase is not enough // there are three cases (lower, upper, title), some characters have no case, @@ -213,11 +216,17 @@ Methods to Change Case u('Die O\'Brian Straße')->folded(); // "die o'brian strasse" // changes all graphemes/code points to upper case - u('foo BAR')->upper(); // 'FOO BAR' + u('foo BAR bΞ¬z')->upper(); // 'FOO BAR BΞ†Z' + // changes all graphemes/code points to upper case according to locale-specific case mappings + u('foo BAR bΞ¬z')->localeUpper('en'); // 'FOO BAR BΞ†Z' + u('foo BAR bΞ¬z')->localeUpper('el'); // 'FOO BAR BAZ' // changes all graphemes/code points to "title case" - u('foo bar')->title(); // 'Foo bar' - u('foo bar')->title(true); // 'Foo Bar' + u('foo ijssel ')->title(); // 'Foo ijssel' + u('foo ijssel')->title(true); // 'Foo Ijssel' + // changes all graphemes/code points to "title case" according to locale-specific case mappings + u('foo ijssel')->localeTitle('en'); // 'Foo ijssel' + u('foo ijssel')->localeTitle('nl'); // 'Foo IJssel' // changes all graphemes/code points to camelCase u('Foo: Bar-baz.')->camel(); // 'fooBarBaz' @@ -226,6 +235,10 @@ Methods to Change Case // other cases can be achieved by chaining methods. E.g. PascalCase: u('Foo: Bar-baz.')->camel()->title(); // 'FooBarBaz' +.. versionadded:: 7.1 + The ``localeLower()``, ``localeUpper()`` and ``localeTitle()`` methods were + introduced in Symfony 7.1. + The methods of all string classes are case-sensitive by default. You can perform case-insensitive operations with the ``ignoreCase()`` method:: From 32807059cf0c0f42925eaf7af64320f7338d48e2 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 20 Nov 2023 09:12:08 +0100 Subject: [PATCH 44/99] [Form] Deprecate using `UrlType` without setting `default_protocol` --- reference/forms/types/url.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/forms/types/url.rst b/reference/forms/types/url.rst index 5f97fcb89a4..96984b23226 100644 --- a/reference/forms/types/url.rst +++ b/reference/forms/types/url.rst @@ -31,6 +31,11 @@ If a value is submitted that doesn't begin with some protocol (e.g. ``http://``, ``ftp://``, etc), this protocol will be prepended to the string when the data is submitted to the form. +.. deprecated:: 7.1 + + Not setting the ``default_protocol`` option is deprecated since Symfony 7.1 + and will default to ``null`` in Symfony 8.0. + Overridden Options ------------------ From 64ad9e659ac34d56611f8aaa6ef161ebb8bf5fc0 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 20 Nov 2023 10:25:52 +0100 Subject: [PATCH 45/99] [DependencyInjection] Prepend extension config with ContainerConfigurator --- bundles/prepend_extension.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/bundles/prepend_extension.rst b/bundles/prepend_extension.rst index bed3d06da43..4bd1c7c6a67 100644 --- a/bundles/prepend_extension.rst +++ b/bundles/prepend_extension.rst @@ -186,6 +186,34 @@ method:: The ``prependExtension()`` method, like ``prepend()``, is called only at compile time. +Alternatively, you can use the ``prepend`` parameter of the +:method:`Symfony\\Component\\DependencyInjection\\Loader\\ContainerConfigurator::extension` +method:: + + use Symfony\Component\DependencyInjection\ContainerBuilder; + use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; + use Symfony\Component\HttpKernel\Bundle\AbstractBundle; + + class FooBundle extends AbstractBundle + { + public function prependExtension(ContainerConfigurator $containerConfigurator, ContainerBuilder $containerBuilder): void + { + // ... + + $containerConfigurator->extension('framework', [ + 'cache' => ['prefix_seed' => 'foo/bar'], + ], prepend: true); + + // ... + } + } + +.. versionadded:: 7.1 + + The ``prepend`` parameter of the + :method:`Symfony\\Component\\DependencyInjection\\Loader\\ContainerConfigurator::extension` + method was added in Symfony 7.1. + More than one Bundle using PrependExtensionInterface ---------------------------------------------------- From 0091e415339f4ffa6d3300cde661cd58f0a92e8d Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 20 Nov 2023 16:28:23 +0100 Subject: [PATCH 46/99] Clean deprecated directives --- components/http_foundation.rst | 5 ----- components/var_exporter.rst | 6 ------ 2 files changed, 11 deletions(-) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 47be5693bb0..52b999f0f2c 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -518,11 +518,6 @@ It is possible to define partitioned cookies, also known as `CHIPS`_, by using t // you can also set the partitioned argument to true when using the `create()` factory method $cookie = Cookie::create('name', 'value', partitioned: true); -.. versionadded:: 6.4 - - The :method:`Symfony\\Component\\HttpFoundation\\Cookie::withPartitioned` - method was introduced in Symfony 6.4. - Managing the HTTP Cache ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/components/var_exporter.rst b/components/var_exporter.rst index 2b01b7a3f2a..634e4be78cb 100644 --- a/components/var_exporter.rst +++ b/components/var_exporter.rst @@ -224,12 +224,6 @@ initialized:: } } -.. deprecated:: 6.4 - - Using an array of closures for property-based initialization in the - ``createLazyGhost()`` method is deprecated since Symfony 6.4. Pass - a single closure that initializes the whole object instead. - :class:`Symfony\\Component\\VarExporter\\LazyGhostTrait` also allows to convert non-lazy classes to lazy ones:: From 4eb2f258b6552f28e69691c34ab60978c82ab60c Mon Sep 17 00:00:00 2001 From: Antoine Lamirault Date: Sun, 19 Nov 2023 15:40:05 +0100 Subject: [PATCH 47/99] [DependencyInjection] Add urlencode function to EnvVarProcessor --- configuration/env_var_processors.rst | 50 ++++++++++++++++++++++++++++ doctrine.rst | 9 ++--- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/configuration/env_var_processors.rst b/configuration/env_var_processors.rst index eba9f4a482c..fc512c84e8e 100644 --- a/configuration/env_var_processors.rst +++ b/configuration/env_var_processors.rst @@ -812,6 +812,56 @@ Symfony provides the following env var processors: // config/services.php $container->setParameter('typed_env', '%env(defined:FOO)%'); +.. _urlencode_environment_variable_processor: + +``env(urlencode:FOO)`` + Urlencode the content of ``FOO`` env var. This is especially useful when + ``FOO`` value is not compatible with DSN syntax. + + .. configuration-block:: + + .. code-block:: yaml + + # config/packages/framework.yaml + parameters: + env(DATABASE_URL): 'mysql://db_user:foo@b$r@127.0.0.1:3306/db_name' + encoded_database_url: '%env(urlencode:DATABASE_URL)%' + + .. code-block:: xml + + + + + + + mysql://db_user:foo@b$r@127.0.0.1:3306/db_name + %env(urlencode:DATABASE_URL)% + + + + .. code-block:: php + + // config/packages/framework.php + namespace Symfony\Component\DependencyInjection\Loader\Configurator; + + use Symfony\Component\DependencyInjection\ContainerBuilder; + use Symfony\Config\FrameworkConfig; + + return static function (ContainerBuilder $container): void { + $container->setParameter('env(DATABASE_URL)', 'mysql://db_user:foo@b$r@127.0.0.1:3306/db_name'); + $container->setParameter('encoded_database_url', '%env(urlencode:DATABASE_URL)%'); + }; + + .. versionadded:: 7.1 + + The ``env(urlencode:...)`` env var processor was introduced in Symfony 7.1. + It is also possible to combine any number of processors: .. configuration-block:: diff --git a/doctrine.rst b/doctrine.rst index f17307108c1..b024c4e7a4c 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -59,10 +59,11 @@ The database connection information is stored as an environment variable called If the username, password, host or database name contain any character considered special in a URI (such as ``+``, ``@``, ``$``, ``#``, ``/``, ``:``, ``*``, ``!``, ``%``), - you must encode them. See `RFC 3986`_ for the full list of reserved characters or - use the :phpfunction:`urlencode` function to encode them. In this case you need to - remove the ``resolve:`` prefix in ``config/packages/doctrine.yaml`` to avoid errors: - ``url: '%env(DATABASE_URL)%'`` + you must encode them. See `RFC 3986`_ for the full list of reserved characters. + You can use the :phpfunction:`urlencode` function to encode them or + the :ref:`urlencode environment variable processor `. + In this case you need to remove the ``resolve:`` prefix in ``config/packages/doctrine.yaml`` + to avoid errors: ``url: '%env(DATABASE_URL)%'`` Now that your connection parameters are setup, Doctrine can create the ``db_name`` database for you: From 296ee9de94f2652b2ffed15b459d5dc2f13438b5 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 21 Nov 2023 14:39:56 +0100 Subject: [PATCH 48/99] Tweaks --- components/string.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/string.rst b/components/string.rst index ba73e7387b6..36df10f4597 100644 --- a/components/string.rst +++ b/components/string.rst @@ -222,11 +222,11 @@ Methods to Change Case u('foo BAR bΞ¬z')->localeUpper('el'); // 'FOO BAR BAZ' // changes all graphemes/code points to "title case" - u('foo ijssel ')->title(); // 'Foo ijssel' + u('foo ijssel')->title(); // 'Foo ijssel' u('foo ijssel')->title(true); // 'Foo Ijssel' // changes all graphemes/code points to "title case" according to locale-specific case mappings - u('foo ijssel')->localeTitle('en'); // 'Foo ijssel' - u('foo ijssel')->localeTitle('nl'); // 'Foo IJssel' + u('foo ijssel')->localeTitle('en'); // 'Foo ijssel' + u('foo ijssel')->localeTitle('nl'); // 'Foo IJssel' // changes all graphemes/code points to camelCase u('Foo: Bar-baz.')->camel(); // 'fooBarBaz' From bd32bca3dd78231b066d59e6af4aeba0e910492e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 21 Nov 2023 14:47:57 +0100 Subject: [PATCH 49/99] Mention the PHP urlencode() function --- configuration/env_var_processors.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configuration/env_var_processors.rst b/configuration/env_var_processors.rst index fc512c84e8e..6953781e187 100644 --- a/configuration/env_var_processors.rst +++ b/configuration/env_var_processors.rst @@ -815,8 +815,9 @@ Symfony provides the following env var processors: .. _urlencode_environment_variable_processor: ``env(urlencode:FOO)`` - Urlencode the content of ``FOO`` env var. This is especially useful when - ``FOO`` value is not compatible with DSN syntax. + Encodes the content of the ``FOO`` env var using the :phpfunction:`urlencode` + PHP function. This is especially useful when ``FOO`` value is not compatible + with DSN syntax. .. configuration-block:: From c3a8aac346ea87df859a3df276872ba58d3231ae Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 21 Nov 2023 17:16:37 +0100 Subject: [PATCH 50/99] remove versionadded directive for 6.3 --- components/serializer.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index 0a36d79be20..67aedbef466 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -1275,11 +1275,6 @@ to ``true``:: $result = $normalizer->denormalize($data, Dummy::class, 'json', [AbstractNormalizer::REQUIRE_ALL_PROPERTIES => true]); // throws Symfony\Component\Serializer\Exception\MissingConstructorArgumentException -.. versionadded:: 6.3 - - The ``AbstractNormalizer::PREVENT_NULLABLE_FALLBACK`` context option - was introduced in Symfony 6.3. - Skipping Uninitialized Properties --------------------------------- From 5e32c4bb2466c73d6b644bcd5647c3d42e953b17 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 22 Nov 2023 09:51:22 +0100 Subject: [PATCH 51/99] fix versionadded syntax --- components/string.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/components/string.rst b/components/string.rst index 36df10f4597..323750921a8 100644 --- a/components/string.rst +++ b/components/string.rst @@ -236,6 +236,7 @@ Methods to Change Case u('Foo: Bar-baz.')->camel()->title(); // 'FooBarBaz' .. versionadded:: 7.1 + The ``localeLower()``, ``localeUpper()`` and ``localeTitle()`` methods were introduced in Symfony 7.1. From 7cc8290969d30fd708807b8851558bfefbf173e5 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Thu, 23 Nov 2023 09:08:07 +0100 Subject: [PATCH 52/99] [HttpKernel] Introduce `ExceptionEvent::isKernelTerminating()` --- components/http_kernel.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/http_kernel.rst b/components/http_kernel.rst index 435ded9063a..fbc59a85a50 100644 --- a/components/http_kernel.rst +++ b/components/http_kernel.rst @@ -519,6 +519,17 @@ comes with an :class:`Symfony\\Component\\HttpKernel\\EventListener\\ErrorListen which if you choose to use, will do this and more by default (see the sidebar below for more details). +The :class:`Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent` exposes the +:method:`Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent::isKernelTerminating` +method, which you can use to determine if the kernel is currently terminating +at the moment the exception was thrown. + +.. versionadded:: 7.1 + + The + :method:`Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent::isKernelTerminating` + method was introduced in Symfony 7.1. + .. note:: When setting a response for the ``kernel.exception`` event, the propagation From 412763397e1705707acb8cdb51a51e14f2ed2ba7 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 25 Nov 2023 17:16:27 +0100 Subject: [PATCH 53/99] Document requirements for DoctrineDbalAdapter --- .../cache/adapters/doctrine_dbal_adapter.rst | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/components/cache/adapters/doctrine_dbal_adapter.rst b/components/cache/adapters/doctrine_dbal_adapter.rst index fc04410bffc..97b67724ce1 100644 --- a/components/cache/adapters/doctrine_dbal_adapter.rst +++ b/components/cache/adapters/doctrine_dbal_adapter.rst @@ -39,5 +39,22 @@ optional arguments:: necessary to detect the database engine and version without opening the connection. +The adapter uses SQL syntax that is optimized for database server that it is connected to. +The following database servers are known to be compatible: + +* MySQL 5.7 and newer +* MariaDB 10.2 and newer +* Oracle 10g and newer +* SQL Server 2012 and newer +* SQLite 3.24 or later +* PostgreSQL 9.5 or later + +.. note:: + + Newer releases of Doctrine DBAL might increase these minimal versions. Please check + the manual page on `Doctrine DBAL Platforms`_ if your database server is compatible + with the installed Doctrine DBAL version. + .. _`Doctrine DBAL Connection`: https://github.com/doctrine/dbal/blob/master/src/Connection.php -.. _`Doctrine DBAL URL`: https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url +.. _`Doctrine DBAL URL`: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/configuration.html#connecting-using-a-url +.. _`Doctrine DBAL Platforms`: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/platforms.html \ No newline at end of file From 875f4076713ad355283d76f4671dc26defc5192e Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 29 Nov 2023 10:43:22 +0100 Subject: [PATCH 54/99] remove versionadded directives for Symfony 6 --- frontend/asset_mapper.rst | 4 ---- messenger.rst | 5 ----- 2 files changed, 9 deletions(-) diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index 765668ed8ab..c0c8e11040e 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -951,10 +951,6 @@ is useful if you want to avoid leaking sensitive files like ``.env`` or This option is enabled by default. -.. versionadded:: 6.4 - - The ``exclude_dotfiles`` option was introduced in Symfony 6.4. - .. _config-importmap-polyfill: ``framework.asset_mapper.importmap_polyfill`` diff --git a/messenger.rst b/messenger.rst index d2f64e74230..8fc7e158cfe 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1586,11 +1586,6 @@ sentinel_master String, if null or empty Sentinel null support is disabled ======================= ===================================== ================================= -.. versionadded:: 6.1 - - The ``persistent_id``, ``retry_interval``, ``read_timeout``, ``timeout``, and - ``sentinel_master`` options were introduced in Symfony 6.1. - .. caution:: There should never be more than one ``messenger:consume`` command running with the same From 1f64e6e878a19d719e636f003c76336b49295720 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 1 Dec 2023 16:10:52 +0100 Subject: [PATCH 55/99] Minor tweak --- components/cache/adapters/doctrine_dbal_adapter.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/cache/adapters/doctrine_dbal_adapter.rst b/components/cache/adapters/doctrine_dbal_adapter.rst index 97b67724ce1..68732ddd3fa 100644 --- a/components/cache/adapters/doctrine_dbal_adapter.rst +++ b/components/cache/adapters/doctrine_dbal_adapter.rst @@ -51,10 +51,10 @@ The following database servers are known to be compatible: .. note:: - Newer releases of Doctrine DBAL might increase these minimal versions. Please check - the manual page on `Doctrine DBAL Platforms`_ if your database server is compatible - with the installed Doctrine DBAL version. + Newer releases of Doctrine DBAL might increase these minimal versions. Check + the manual page on `Doctrine DBAL Platforms`_ if your database server is + compatible with the installed Doctrine DBAL version. .. _`Doctrine DBAL Connection`: https://github.com/doctrine/dbal/blob/master/src/Connection.php .. _`Doctrine DBAL URL`: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/configuration.html#connecting-using-a-url -.. _`Doctrine DBAL Platforms`: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/platforms.html \ No newline at end of file +.. _`Doctrine DBAL Platforms`: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/platforms.html From 7d0f640b523959f2ad6fc6938a36146867146c73 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 1 Dec 2023 16:29:41 +0100 Subject: [PATCH 56/99] Update the Uid version config --- components/uid.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/uid.rst b/components/uid.rst index 8b1c496bdc3..26fd32989a9 100644 --- a/components/uid.rst +++ b/components/uid.rst @@ -90,10 +90,10 @@ configure the behavior of the factory using configuration files:: # config/packages/uid.yaml framework: uid: - default_uuid_version: 6 + default_uuid_version: 7 name_based_uuid_version: 5 name_based_uuid_namespace: 6ba7b810-9dad-11d1-80b4-00c04fd430c8 - time_based_uuid_version: 6 + time_based_uuid_version: 7 time_based_uuid_node: 121212121212 .. code-block:: xml @@ -109,10 +109,10 @@ configure the behavior of the factory using configuration files:: @@ -131,10 +131,10 @@ configure the behavior of the factory using configuration files:: $container->extension('framework', [ 'uid' => [ - 'default_uuid_version' => 6, + 'default_uuid_version' => 7, 'name_based_uuid_version' => 5, 'name_based_uuid_namespace' => '6ba7b810-9dad-11d1-80b4-00c04fd430c8', - 'time_based_uuid_version' => 6, + 'time_based_uuid_version' => 7, 'time_based_uuid_node' => 121212121212, ], ]); @@ -156,7 +156,7 @@ on the configuration you defined:: public function generate(): void { - // This creates a UUID of the version given in the configuration file (v6 by default) + // This creates a UUID of the version given in the configuration file (v7 by default) $uuid = $this->uuidFactory->create(); $nameBasedUuid = $this->uuidFactory->nameBased(/** ... */); From 03b72037ad4d8794bdf232340a702bfc6e5962f7 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 4 Dec 2023 08:56:36 +0100 Subject: [PATCH 57/99] [PropertyInfo] Introduce `PropertyDocBlockExtractorInterface` --- components/property_info.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/components/property_info.rst b/components/property_info.rst index 452966f57d5..ca05d944429 100644 --- a/components/property_info.rst +++ b/components/property_info.rst @@ -183,6 +183,26 @@ for a property:: See :ref:`components-property-info-type` for info about the ``Type`` class. +Documentation Block +~~~~~~~~~~~~~~~~~~~ + +Extractors that implement :class:`Symfony\\Component\\PropertyInfo\\PropertyDocBlockExtractorInterface` +can provide the full documentation block for a property as a string:: + + $docBlock = $propertyInfo->getDocBlock($class, $property); + /* + Example Result + -------------- + string(79): + This is the subsequent paragraph in the DocComment. + It can span multiple lines. + */ + +.. versionadded:: 7.1 + + The :class:`Symfony\\Component\\PropertyInfo\\PropertyDocBlockExtractorInterface`` + interface was introduced in Symfony 7.1. + .. _property-info-description: Description Information @@ -413,6 +433,12 @@ library is present:: // Description information. $phpDocExtractor->getShortDescription($class, $property); $phpDocExtractor->getLongDescription($class, $property); + $phpDocExtractor->getDocBlock($class, $property); + +.. versionadded:: 7.1 + + The :method:`Symfony\\Component\\PropertyInfo\\Extractor\\PhpDocExtractor::getDocBlock`` + method was introduced in Symfony 7.1. PhpStanExtractor ~~~~~~~~~~~~~~~~ From 9cc4a78d32588b009e0b6869376b82418f09180d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 4 Dec 2023 09:04:40 +0100 Subject: [PATCH 58/99] remove versionadded directives for Symfony 6 --- frontend/asset_mapper.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index 730c62b1cbd..64768b8e77b 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -379,10 +379,6 @@ from inside ``app.js``: Handling CSS ------------ -.. versionadded:: 6.4 - - The ability to import CSS files was introduced in Symfony 6.4. - CSS can be added to your page by importing it from a JavaScript file. The default ``assets/app.js`` already imports ``assets/styles/app.css``: @@ -639,10 +635,6 @@ validate the performance of your site! Performance: Understanding Preloading ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.4 - - Automatic preloading of JavaScript files was introduced in Symfony 6.4. - One issue that LightHouse may report is: Avoid Chaining Critical Requests From 4120857b930db4037473660232d912ca4c3b64da Mon Sep 17 00:00:00 2001 From: Daniel Burger <48986191+danielburger1337@users.noreply.github.com> Date: Mon, 4 Dec 2023 09:04:13 +0100 Subject: [PATCH 59/99] [HttpFoundation] Add `UploadedFile::getClientOriginalPath()` to support directory uploads --- controller/upload_file.rst | 14 ++++++++++++-- reference/forms/types/file.rst | 10 +++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/controller/upload_file.rst b/controller/upload_file.rst index c05e78997ba..f638ed0d517 100644 --- a/controller/upload_file.rst +++ b/controller/upload_file.rst @@ -194,13 +194,23 @@ 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::getClientOriginalExtension`), - the original file size (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getSize`) - and the original file name (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getClientOriginalName`). + the original file size (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getSize`), + the original file name (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getClientOriginalName`) + and the original file path (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getClientOriginalPath`). 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; +.. note:: + + If a directory was uploaded, ``getClientOriginalPath`` will contain the **webkitRelativePath** as provided by the browser. + Otherwise this value will be identical to ``getClientOriginalName``. + +.. versionadded:: 7.1 + + The ``getClientOriginalPath`` method was introduced in Symfony 7.1. + You can use the following code to link to the PDF brochure of a product: .. code-block:: html+twig diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 95aab73783a..b4982859b98 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -55,6 +55,10 @@ You might calculate the filename in one of the following ways:: // use the original file name $file->move($directory, $file->getClientOriginalName()); + // when "webkitdirectory" upload was used + // otherwise the value will be the same as getClientOriginalName + // $file->move($directory, $file->getClientOriginalPath()); + // compute a random name and try to guess the extension (more secure) $extension = $file->guessExtension(); if (!$extension) { @@ -63,9 +67,9 @@ You might calculate the filename in one of the following ways:: } $file->move($directory, rand(1, 99999).'.'.$extension); -Using the original name via ``getClientOriginalName()`` is not safe as it -could have been manipulated by the end-user. Moreover, it can contain -characters that are not allowed in file names. You should sanitize the name +Using the original name via ``getClientOriginalName()`` or ``getClientOriginalPath`` +is not safe as it could have been manipulated by the end-user. Moreover, it can contain +characters that are not allowed in file names. You should sanitize the value before using it directly. Read :doc:`/controller/upload_file` for an example of how to manage a file From 1e14f408ff1e4df1e862acadb50a395a550b7efe Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 4 Dec 2023 21:59:51 +0100 Subject: [PATCH 60/99] append parentheses to method names --- controller/upload_file.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/controller/upload_file.rst b/controller/upload_file.rst index f638ed0d517..f50432f5ee3 100644 --- a/controller/upload_file.rst +++ b/controller/upload_file.rst @@ -204,12 +204,13 @@ There are some important things to consider in the code of the above controller: .. note:: - If a directory was uploaded, ``getClientOriginalPath`` will contain the **webkitRelativePath** as provided by the browser. - Otherwise this value will be identical to ``getClientOriginalName``. + If a directory was uploaded, ``getClientOriginalPath()`` will contain + the **webkitRelativePath** as provided by the browser. Otherwise this + value will be identical to ``getClientOriginalName()``. .. versionadded:: 7.1 - The ``getClientOriginalPath`` method was introduced in Symfony 7.1. + The ``getClientOriginalPath()`` method was introduced in Symfony 7.1. You can use the following code to link to the PDF brochure of a product: From 07905b59655e2354eb5f145caff4685d328b6008 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 8 Dec 2023 11:32:08 +0100 Subject: [PATCH 61/99] fix markup --- components/property_info.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/property_info.rst b/components/property_info.rst index ca05d944429..892cd5345a3 100644 --- a/components/property_info.rst +++ b/components/property_info.rst @@ -200,7 +200,7 @@ can provide the full documentation block for a property as a string:: .. versionadded:: 7.1 - The :class:`Symfony\\Component\\PropertyInfo\\PropertyDocBlockExtractorInterface`` + The :class:`Symfony\\Component\\PropertyInfo\\PropertyDocBlockExtractorInterface` interface was introduced in Symfony 7.1. .. _property-info-description: @@ -437,7 +437,7 @@ library is present:: .. versionadded:: 7.1 - The :method:`Symfony\\Component\\PropertyInfo\\Extractor\\PhpDocExtractor::getDocBlock`` + The :method:`Symfony\\Component\\PropertyInfo\\Extractor\\PhpDocExtractor::getDocBlock` method was introduced in Symfony 7.1. PhpStanExtractor From 5d0f97dbc6a77485fb935aff780c47f6217fd773 Mon Sep 17 00:00:00 2001 From: Antoine Lamirault Date: Sat, 9 Dec 2023 10:58:46 +0100 Subject: [PATCH 62/99] [Cache][Messenger] make both options redis_sentinel and sentinel_master available everywhere --- components/cache/adapters/redis_adapter.rst | 8 ++++++++ messenger.rst | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/components/cache/adapters/redis_adapter.rst b/components/cache/adapters/redis_adapter.rst index a25b1a510ed..1550d419081 100644 --- a/components/cache/adapters/redis_adapter.rst +++ b/components/cache/adapters/redis_adapter.rst @@ -200,6 +200,9 @@ Available Options ``redis_sentinel`` (type: ``string``, default: ``null``) Specifies the master name connected to the sentinels. +``sentinel_master`` (type: ``string``, default: ``null``) + Alias of ``redis_sentinel`` option. + ``dbindex`` (type: ``int``, default: ``0``) Specifies the database index to select. @@ -211,6 +214,11 @@ Available Options ``ssl`` (type: ``array``, default: ``null``) SSL context options. See `php.net/context.ssl`_ for more information. +.. versionadded:: 7.1 + + The option `sentinel_master` as an alias for `redis_sentinel` was introduced + in Symfony 7.1. + .. note:: When using the `Predis`_ library some additional Predis-specific options are available. diff --git a/messenger.rst b/messenger.rst index 14ce030f840..07a734d96c9 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1582,9 +1582,14 @@ read_timeout Float, value in seconds ``0`` timeout Connection timeout. Float, value in ``0`` seconds default indicates unlimited sentinel_master String, if null or empty Sentinel null - support is disabled +redis_sentinel support is disabled ======================= ===================================== ================================= +.. versionadded:: 7.1 + + The option `redis_sentinel` as an alias for `sentinel_master` was introduced + in Symfony 7.1. + .. caution:: There should never be more than one ``messenger:consume`` command running with the same From ca09716046bd2bf2ccc74e191395e4b26cabd93a Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sat, 9 Dec 2023 11:23:04 +0100 Subject: [PATCH 63/99] - --- workflow/dumping-workflows.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/workflow/dumping-workflows.rst b/workflow/dumping-workflows.rst index d31b1eb15a8..8262fefd6c1 100644 --- a/workflow/dumping-workflows.rst +++ b/workflow/dumping-workflows.rst @@ -80,10 +80,6 @@ The DOT image will look like this : The ``label`` metadata is not included in the dumped metadata, because it is used as a place's title. -.. versionadded:: 6.4 - - The ``--with-metadata`` option was introduced in Symfony 6.4. - You can use ``metadata`` with the following keys to style the workflow: * for places: From 1601f09e61fb7b216eab6f09c43c7bb59841e62b Mon Sep 17 00:00:00 2001 From: Jade Xau <98119101+ChibyJade@users.noreply.github.com> Date: Sat, 9 Dec 2023 12:21:01 +0100 Subject: [PATCH 64/99] Add getEnabledTransition() method --- workflow.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/workflow.rst b/workflow.rst index de69ef6ae73..eb824cc4531 100644 --- a/workflow.rst +++ b/workflow.rst @@ -310,6 +310,15 @@ machine type, use ``camelCased workflow name + StateMachine``:: } } +To get all enabled transitions of a Workflow, you can use +:method:`Symfony\\Component\\Workflow\\WorkflowInterface::getEnabledTransitions` +method. + +.. versionadded:: 7.1 + + The :method:`Symfony\\Component\\Workflow\\WorkflowInterface::getEnabledTransitions` method + was introduced in Symfony 7.1. + Workflows can also be injected thanks to their name and the :class:`Symfony\\Component\\DependencyInjection\\Attribute\\Target` attribute:: From 0dc5f71cc141f83d1e94543c387e07a14fd9f3a1 Mon Sep 17 00:00:00 2001 From: Jade Xau <98119101+ChibyJade@users.noreply.github.com> Date: Sat, 9 Dec 2023 12:25:04 +0100 Subject: [PATCH 65/99] Apply suggestions from code review --- workflow.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workflow.rst b/workflow.rst index eb824cc4531..3f627d2170f 100644 --- a/workflow.rst +++ b/workflow.rst @@ -310,13 +310,13 @@ machine type, use ``camelCased workflow name + StateMachine``:: } } -To get all enabled transitions of a Workflow, you can use -:method:`Symfony\\Component\\Workflow\\WorkflowInterface::getEnabledTransitions` +To get the enabled transition of a Workflow, you can use +:method:`Symfony\\Component\\Workflow\\WorkflowInterface::getEnabledTransition` method. .. versionadded:: 7.1 - The :method:`Symfony\\Component\\Workflow\\WorkflowInterface::getEnabledTransitions` method + The :method:`Symfony\\Component\\Workflow\\WorkflowInterface::getEnabledTransition` method was introduced in Symfony 7.1. Workflows can also be injected thanks to their name and the From 0fe3b79a33ee91ea4f9470d282ebe2baf03b8899 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sat, 9 Dec 2023 12:25:45 +0100 Subject: [PATCH 66/99] Update workflow.rst --- workflow.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow.rst b/workflow.rst index 3f627d2170f..99d23cdcfae 100644 --- a/workflow.rst +++ b/workflow.rst @@ -316,8 +316,8 @@ method. .. versionadded:: 7.1 - The :method:`Symfony\\Component\\Workflow\\WorkflowInterface::getEnabledTransition` method - was introduced in Symfony 7.1. + The :method:`Symfony\\Component\\Workflow\\WorkflowInterface::getEnabledTransition` + method was introduced in Symfony 7.1. Workflows can also be injected thanks to their name and the :class:`Symfony\\Component\\DependencyInjection\\Attribute\\Target` From 0c017fd5111e908ea177fc8625d8bacd9cf5ec35 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Fri, 8 Dec 2023 15:55:19 +0100 Subject: [PATCH 67/99] Add Azure mailer --- mailer.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mailer.rst b/mailer.rst index 3da6c120cb2..fe55ed2d858 100644 --- a/mailer.rst +++ b/mailer.rst @@ -103,6 +103,7 @@ via a third-party provider: Service Install with ===================== ============================================== `Amazon SES`_ ``composer require symfony/amazon-mailer`` +`Azure`_ ``composer require symfony/azure-mailer`` `Brevo`_ ``composer require symfony/brevo-mailer`` `Infobip`_ ``composer require symfony/infobip-mailer`` `Mailchimp Mandrill`_ ``composer require symfony/mailchimp-mailer`` @@ -115,6 +116,10 @@ Service Install with `SendGrid`_ ``composer require symfony/sendgrid-mailer`` ===================== ============================================== +.. versionadded:: 7.1 + + The Azure integration was introduced in Symfony 7.1. + .. note:: As a convenience, Symfony also provides support for Gmail (``composer @@ -167,6 +172,8 @@ party provider: | | - HTTP ses+https://ACCESS_KEY:SECRET_KEY@default | | | - API ses+api://ACCESS_KEY:SECRET_KEY@default | +------------------------+-----------------------------------------------------+ +| `Azure`_ | - API azure+api://ACS_RESOURCE_NAME:KEY@default | ++------------------------+-----------------------------------------------------+ | `Brevo`_ | - SMTP brevo+smtp://USERNAME:PASSWORD@default | | | - HTTP n/a | | | - API brevo+api://KEY@default | @@ -1815,6 +1822,7 @@ the :class:`Symfony\\Bundle\\FrameworkBundle\\Test\\MailerAssertionsTrait`:: handler. .. _`Amazon SES`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Amazon/README.md +.. _`Azure`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Azure/README.md .. _`App Password`: https://support.google.com/accounts/answer/185833 .. _`Brevo`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Mailer/Bridge/Brevo/README.md .. _`default_socket_timeout`: https://www.php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout From 566fdd0d6ea379e84d2b9c5db26a10ffa4716630 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sat, 9 Dec 2023 19:30:11 +0100 Subject: [PATCH 68/99] IsCsrfTokenValid documentation --- security/csrf.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/security/csrf.rst b/security/csrf.rst index be7bb909f61..2e2197f1547 100644 --- a/security/csrf.rst +++ b/security/csrf.rst @@ -164,6 +164,26 @@ method to check its validity:: } } +Alternatively you can use the +:class:`Symfony\\Component\\Security\\Http\\Attribute\\IsCsrfTokenValid` +attribute on the controller action:: + + use Symfony\Component\HttpFoundation\Request; + use Symfony\Component\HttpFoundation\Response; + use Symfony\Component\Security\Http\Attribute\IsCsrfTokenValid; + // ... + + #[IsCsrfTokenValid('delete-item', tokenKey: 'token')] + public function delete(Request $request): Response + { + // ... do something, like deleting an object + } + +.. versionadded:: 7.1 + + The :class:`Symfony\\Component\\Security\\Http\\Attribute\\IsCsrfTokenValid` + attribute was introduced in Symfony 7.1. + CSRF Tokens and Compression Side-Channel Attacks ------------------------------------------------ From 47caec8a448b0ab696d419959bd7ca929ccbe60b Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sat, 9 Dec 2023 19:37:43 +0100 Subject: [PATCH 69/99] Remove obsolete versionadded directive --- security/access_token.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/security/access_token.rst b/security/access_token.rst index 37942e950c4..29fbfbc8bb6 100644 --- a/security/access_token.rst +++ b/security/access_token.rst @@ -700,11 +700,6 @@ create your own User from the claims, you must Creating Users from Token ------------------------- -.. versionadded:: 6.3 - - The possibility to omit the user provider in case of stateless firewalls - was introduced in Symfony 6.3. - Some types of tokens (for instance OIDC) contain all information required to create a user entity (e.g. username and roles). In this case, you don't need a user provider to create a user from the database:: From 7b47bdc409d47c082a7a0c7c5d9713ba9606d9b1 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sat, 9 Dec 2023 19:42:52 +0100 Subject: [PATCH 70/99] Add `#[IsCsrfTokenValid]` to attributes reference --- reference/attributes.rst | 1 + security/csrf.rst | 2 ++ 2 files changed, 3 insertions(+) diff --git a/reference/attributes.rst b/reference/attributes.rst index cf21c5a7c45..f61c78b9a3a 100644 --- a/reference/attributes.rst +++ b/reference/attributes.rst @@ -80,6 +80,7 @@ Security ~~~~~~~~ * :ref:`CurrentUser ` +* :ref:`IsCsrfTokenValid ` * :ref:`IsGranted ` Serializer diff --git a/security/csrf.rst b/security/csrf.rst index 2e2197f1547..0352d7e6f87 100644 --- a/security/csrf.rst +++ b/security/csrf.rst @@ -164,6 +164,8 @@ method to check its validity:: } } +.. _csrf-controller-attributes: + Alternatively you can use the :class:`Symfony\\Component\\Security\\Http\\Attribute\\IsCsrfTokenValid` attribute on the controller action:: From 2e45f6af526da40d228dafe40bf31e57e262da76 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Sun, 10 Dec 2023 09:54:31 +0100 Subject: [PATCH 71/99] [Form] Add `keep_as_list` option --- reference/forms/types/collection.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index d1e1f0fb00b..2d91bfd06bd 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -229,6 +229,27 @@ you'd use the :doc:`EmailType `. If you want to embed a collection of some other form, pass the form type class as this option (e.g. ``MyFormType::class``). +keep_as_list +~~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +When set to ``true``, the ``keep_as_list`` option affects the reindexing +of nested form names within a collection. This feature is particularly useful +when working with collection types and removing items from the collection +during form submission. + +When this option is set to ``false``, if you have a collection of 3 items and +you remove the second item, the indexes will be ``0`` and ``2`` when validating +the collection. However, by enabling the ``keep_as_list`` option and setting +it to ``true``, the indexes will be reindexed as ``0`` and ``1``. This ensures +that the indexes remain consecutive and do not have gaps, providing a clearer +and more predictable structure for your nested forms. + +.. versionadded:: 7.1 + + The ``keep_as_list`` option was introduced in Symfony 7.1. + prototype ~~~~~~~~~ From 2c88dc8c3162ad4e96bf6d309f19ed27eb13689e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4dlich?= Date: Sat, 25 Nov 2023 10:45:09 +0100 Subject: [PATCH 72/99] Improve `debug:serializer` command documentation by adding `serializedPath` --- serializer.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/serializer.rst b/serializer.rst index ef155a1a45d..9731e9b869e 100644 --- a/serializer.rst +++ b/serializer.rst @@ -511,20 +511,22 @@ given class: | | "groups" => [ | | | "book:read", | | | "book:write", | - | | ] | + | | ], | | | "maxDepth" => 1, | - | | "serializedName" => "book_name" | - | | "ignore" => false | + | | "serializedName" => "book_name", | + | | "serializedPath" => null, | + | | "ignore" => false, | | | "normalizationContexts" => [], | | | "denormalizationContexts" => [] | | | ] | | isbn | [ | | | "groups" => [ | | | "book:read", | - | | ] | + | | ], | | | "maxDepth" => null, | - | | "serializedName" => null | - | | "ignore" => false | + | | "serializedName" => null, | + | | "serializedPath" => [data][isbn], | + | | "ignore" => false, | | | "normalizationContexts" => [], | | | "denormalizationContexts" => [] | | | ] | From 4336b8735cf2e22004c51302d7b5678afab3e32e Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 12 Dec 2023 12:15:00 +0100 Subject: [PATCH 73/99] - --- reference/configuration/framework.rst | 4 ---- webhook.rst | 4 ---- 2 files changed, 8 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index b5a2c547eb1..894cf7a82c5 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -3550,10 +3550,6 @@ Adds a `Link HTTP header`_ to the response. webhook ~~~~~~~ -.. versionadded:: 6.3 - - The Webhook configuration was introduced in Symfony 6.3. - The ``webhook`` option (and its children) are used to configure the webhooks defined in your application. Read more about the options in the :ref:`Webhook documentation `. diff --git a/webhook.rst b/webhook.rst index f9bde7451a9..f65760182a8 100644 --- a/webhook.rst +++ b/webhook.rst @@ -1,10 +1,6 @@ Webhook ======= -.. versionadded:: 6.3 - - The Webhook component was introduced in Symfony 6.3. - The Webhook component is used to respond to remote webhooks to trigger actions in your application. This document focuses on using webhooks to listen to remote events in other Symfony components. From cc8abdd50c873b90d44ff91291c33fc9df0bb152 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 12 Dec 2023 13:25:01 +0100 Subject: [PATCH 74/99] - --- webhook.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/webhook.rst b/webhook.rst index 4e7377cf730..74e48499937 100644 --- a/webhook.rst +++ b/webhook.rst @@ -86,15 +86,6 @@ Sendgrid ``mailer.webhook.request_parser.sendgrid`` Vonage ``notifier.webhook.request_parser.vonage`` ======== ========================================== -.. versionadded:: 6.3 - - The support for Mailgun and Postmark was introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The support for Brevo, Mailjet, Sendgrid and Vonage was introduced in - Symfony 6.4. - Set up the webhook in the third-party mailer. For Mailgun, you can do this in the control panel. As URL, make sure to use the ``/webhook/mailer_mailgun`` path behind the domain you're using. From 8ebe0dd9de58c25e266bfcc943198f5829006d4f Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 12 Dec 2023 14:10:17 +0100 Subject: [PATCH 75/99] [Messenger] Add `--all` option to `messenger:consume` --- messenger.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/messenger.rst b/messenger.rst index 133283fe465..adaec5a9883 100644 --- a/messenger.rst +++ b/messenger.rst @@ -485,6 +485,17 @@ The first argument is the receiver's name (or service id if you routed to a custom service). By default, the command will run forever: looking for new messages on your transport and handling them. This command is called your "worker". +If you want to consume messages from all available receivers, you can use the +command with the ``--all`` option: + +.. code-block:: terminal + + $ php bin/console messenger:consume --all + +.. versionadded:: 7.1 + + The ``--all`` option was introduced in Symfony 7.1. + .. tip:: To properly stop a worker, throw an instance of From 457d5e566b21758cc2b84f987eef3d56388f4ab4 Mon Sep 17 00:00:00 2001 From: Louis-Marie Date: Wed, 13 Dec 2023 08:50:00 +0100 Subject: [PATCH 76/99] Remove @dev --- setup.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.rst b/setup.rst index 49b6f9482de..7da5a5fcb12 100644 --- a/setup.rst +++ b/setup.rst @@ -46,10 +46,10 @@ application: .. code-block:: terminal # run this if you are building a traditional web application - $ symfony new my_project_directory --version="7.0.*@dev" --webapp + $ symfony new my_project_directory --version="7.0.*" --webapp # run this if you are building a microservice, console application or API - $ symfony new my_project_directory --version="7.0.*@dev" + $ symfony new my_project_directory --version="7.0.*" The only difference between these two commands is the number of packages installed by default. The ``--webapp`` option installs all the packages that you @@ -61,12 +61,12 @@ Symfony application using Composer: .. code-block:: terminal # run this if you are building a traditional web application - $ composer create-project symfony/skeleton:"7.0.*@dev" my_project_directory + $ composer create-project symfony/skeleton:"7.0.*" my_project_directory $ cd my_project_directory $ composer require webapp # run this if you are building a microservice, console application or API - $ composer create-project symfony/skeleton:"7.0.*@dev" my_project_directory + $ composer create-project symfony/skeleton:"7.0.*" my_project_directory No matter which command you run to create the Symfony application. All of them will create a new ``my_project_directory/`` directory, download some dependencies From 46de3924533620cd415c2f5f3d5123b134c96da7 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 13 Dec 2023 08:52:43 +0100 Subject: [PATCH 77/99] [Cache] Deprecate `CouchbaseBucketAdapter` --- components/cache/adapters/couchbasebucket_adapter.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/cache/adapters/couchbasebucket_adapter.rst b/components/cache/adapters/couchbasebucket_adapter.rst index c279e1f8780..8927a8c53f8 100644 --- a/components/cache/adapters/couchbasebucket_adapter.rst +++ b/components/cache/adapters/couchbasebucket_adapter.rst @@ -1,6 +1,12 @@ Couchbase Bucket Cache Adapter ============================== +.. deprecated:: 7.1 + + The ``CouchbaseBucketAdapter`` is deprecated since Symfony 7.1, use the + :doc:`CouchbaseCollectionAdapter ` + instead. + This adapter stores the values in-memory using one (or more) `Couchbase server`_ instances. Unlike the :doc:`APCu adapter `, and similarly to the :doc:`Memcached adapter `, it is not limited to the current server's From 62b41a0cd5c01d15731d637a00a1799e61b767b9 Mon Sep 17 00:00:00 2001 From: Matthieu Lempereur Date: Wed, 13 Dec 2023 09:36:51 +0100 Subject: [PATCH 78/99] remove 6.x versionnaded in webhook --- webhook.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/webhook.rst b/webhook.rst index 889f6bac174..8be38d80408 100644 --- a/webhook.rst +++ b/webhook.rst @@ -145,14 +145,6 @@ Twilio ``notifier.webhook.request_parser.twilio`` Vonage ``notifier.webhook.request_parser.vonage`` ============ ========================================== -.. versionadded:: 6.3 - - The support for Twilio was introduced in Symfony 6.3. - -.. versionadded:: 6.4 - - The support for Vonage was introduced in Symfony 6.4. - For SMS transports, an additional ``SmsEvent`` is available in the RemoteEvent consumer:: From 6de3f76d83cae369726403e8af132cadfa492da3 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 13 Dec 2023 10:30:46 +0100 Subject: [PATCH 79/99] remove versionadded directive for Symfony 6 --- security.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/security.rst b/security.rst index 2c67ec8d073..e275ec4add0 100644 --- a/security.rst +++ b/security.rst @@ -1857,11 +1857,6 @@ you have imported the logout route loader in your routes: $routes->import('security.route_loader.logout', 'service'); }; -.. versionadded:: 6.4 - - The :class:`Symfony\\Bundle\\SecurityBundle\\Routing\\LogoutRouteLoader` was - introduced in Symfony 6.4. - Logout programmatically ~~~~~~~~~~~~~~~~~~~~~~~ From 57f78401f85694b174572dadab73a0ffdab6380b Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 14 Dec 2023 08:21:40 +0100 Subject: [PATCH 80/99] - --- messenger.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/messenger.rst b/messenger.rst index 58573dab7a9..25d6b519960 100644 --- a/messenger.rst +++ b/messenger.rst @@ -884,10 +884,6 @@ running the ``messenger:consume`` command. Rate limited transport ~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 6.2 - - The ``rate_limiter`` option was introduced in Symfony 6.2. - Sometimes you might need to rate limit your message worker. You can configure a rate limiter on a transport (requires the :doc:`RateLimiter component `) by setting its ``rate_limiter`` option: From be9cb027cc149a1ae6f1b8b17339b0d21c02d661 Mon Sep 17 00:00:00 2001 From: Maxime Doutreluingne Date: Fri, 15 Dec 2023 18:10:04 +0100 Subject: [PATCH 81/99] [Notifier] Add Bluesky notifier bridge --- console.rst | 4 ---- notifier.rst | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/console.rst b/console.rst index 6a0806c730a..700ed536486 100644 --- a/console.rst +++ b/console.rst @@ -611,10 +611,6 @@ profile is accessible through the web page of the profiler. terminal supports links). If you run it in debug verbosity (``-vvv``) you'll also see the time and memory consumed by the command. -.. versionadded:: 6.4 - - The ``--profile`` option was introduced in Symfony 6.4. - Learn More ---------- diff --git a/notifier.rst b/notifier.rst index 42f55201073..8cb9b87c0dd 100644 --- a/notifier.rst +++ b/notifier.rst @@ -221,6 +221,7 @@ integration with these chat services: Service Package DSN ======================================= ==================================== ============================================================================= `AmazonSns`_ ``symfony/amazon-sns-notifier`` ``sns://ACCESS_KEY:SECRET_KEY@default?region=REGION`` +`Bluesky`_ ``symfony/bluesky-notifier`` ``bluesky://USERNAME:PASSWORD@default`` `Chatwork`_ ``symfony/chatwork-notifier`` ``chatwork://API_TOKEN@default?room_id=ID`` `Discord`_ ``symfony/discord-notifier`` ``discord://TOKEN@default?webhook_id=ID`` `FakeChat`_ ``symfony/fake-chat-notifier`` ``fakechat+email://default?to=TO&from=FROM`` or ``fakechat+logger://default`` @@ -241,6 +242,10 @@ Service Package D `Zulip`_ ``symfony/zulip-notifier`` ``zulip://EMAIL:TOKEN@HOST?channel=CHANNEL`` ====================================== ==================================== ============================================================================= +.. versionadded:: 7.1 + + The ``Bluesky`` integration was introduced in Symfony 7.1. + Chatters are configured using the ``chatter_transports`` setting: .. code-block:: bash @@ -942,6 +947,7 @@ is dispatched. Listeners receive a .. _`AllMySms`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/AllMySms/README.md .. _`AmazonSns`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/AmazonSns/README.md .. _`Bandwidth`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Bandwidth/README.md +.. _`Bluesky`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Bluesky/README.md .. _`Brevo`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Brevo/README.md .. _`Chatwork`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Chatwork/README.md .. _`Clickatell`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Clickatell/README.md From dbcfe2f3bd91a421007e44ecc372f7f5294c27fc Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sat, 16 Dec 2023 09:57:50 +0100 Subject: [PATCH 82/99] - --- console.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/console.rst b/console.rst index 6a0806c730a..700ed536486 100644 --- a/console.rst +++ b/console.rst @@ -611,10 +611,6 @@ profile is accessible through the web page of the profiler. terminal supports links). If you run it in debug verbosity (``-vvv``) you'll also see the time and memory consumed by the command. -.. versionadded:: 6.4 - - The ``--profile`` option was introduced in Symfony 6.4. - Learn More ---------- From 9e47f5fe8489c1b6aadbb241a4fe30faf1aebfea Mon Sep 17 00:00:00 2001 From: Farhad Safarov Date: Sun, 17 Dec 2023 01:03:31 +0300 Subject: [PATCH 83/99] [Notifier] Add Unifonic notifier bridge --- notifier.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/notifier.rst b/notifier.rst index 8cb9b87c0dd..b57f501687d 100644 --- a/notifier.rst +++ b/notifier.rst @@ -98,6 +98,7 @@ Service Package DSN `Telnyx`_ ``symfony/telnyx-notifier`` ``telnyx://API_KEY@default?from=FROM&messaging_profile_id=MESSAGING_PROFILE_ID`` `TurboSms`_ ``symfony/turbo-sms-notifier`` ``turbosms://AUTH_TOKEN@default?from=FROM`` `Twilio`_ ``symfony/twilio-notifier`` ``twilio://SID:TOKEN@default?from=FROM`` yes +`Unifonic`_ ``symfony/unifonic-notifier`` ``unifonic://APP_SID@default?from=FROM`` `Vonage`_ ``symfony/vonage-notifier`` ``vonage://KEY:SECRET@default?from=FROM`` yes `Yunpian`_ ``symfony/yunpian-notifier`` ``yunpian://APIKEY@default`` ================== ===================================== ========================================================================================================================= =============== @@ -244,7 +245,7 @@ Service Package D .. versionadded:: 7.1 - The ``Bluesky`` integration was introduced in Symfony 7.1. + The ``Bluesky`` and ``Unifonic`` integrations were introduced in Symfony 7.1. Chatters are configured using the ``chatter_transports`` setting: @@ -1008,6 +1009,7 @@ is dispatched. Listeners receive a .. _`TurboSms`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/TurboSms/README.md .. _`Twilio`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Twilio/README.md .. _`Twitter`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Twitter/README.md +.. _`Unifonic`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Unifonic/README.md .. _`Vonage`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Vonage/README.md .. _`Yunpian`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Yunpian/README.md .. _`Zendesk`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Zendesk/README.md From 6bd49488eebe6195e7df021b9057988c539b49cb Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Sun, 17 Dec 2023 20:29:35 +0100 Subject: [PATCH 84/99] [HttpClient] Add `JsonMockResponse::fromFile()` and `MockResponse::fromFile()` shortcuts --- http_client.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/http_client.rst b/http_client.rst index 2ca591a5098..6d45fc6d6d7 100644 --- a/http_client.rst +++ b/http_client.rst @@ -1905,6 +1905,20 @@ in order when requests are made:: $response1 = $client->request('...'); // returns $responses[0] $response2 = $client->request('...'); // returns $responses[1] +It is also possible to create a +:class:`Symfony\\Component\\HttpClient\\Response\\MockResponse` directly +from a file, which is particularly useful when storing your responses +snapshots in files:: + + use Symfony\Component\HttpClient\Response\MockResponse; + + $response = MockResponse::fromFile('tests/fixtures/response.xml'); + +.. versionadded:: 7.1 + + The :method:`Symfony\\Component\\HttpClient\\Response\\MockResponse::fromFile` + method was introduced in Symfony 7.1. + Another way of using :class:`Symfony\\Component\\HttpClient\\MockHttpClient` is to pass a callback that generates the responses dynamically when it's called:: @@ -2079,6 +2093,19 @@ You can use :class:`Symfony\\Component\\HttpClient\\Response\\JsonMockResponse` 'foo' => 'bar', ]); +Just like :class:`Symfony\\Component\\HttpClient\\Response\\MockResponse`, you can +also create a :class:`Symfony\\Component\\HttpClient\\Response\\JsonMockResponse` +directly from a file:: + + use Symfony\Component\HttpClient\Response\JsonMockResponse; + + $response = JsonMockResponse::fromFile('tests/fixtures/response.json'); + +.. versionadded:: 7.1 + + The :method:`Symfony\\Component\\HttpClient\\Response\\JsonMockResponse::fromFile` + method was introduced in Symfony 7.1. + Testing Request Data ~~~~~~~~~~~~~~~~~~~~ From b89fb23bdd9ed4b8607d69d287cd6136f9d0fbcc Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 19 Dec 2023 20:51:02 +0100 Subject: [PATCH 85/99] [FrameworkBundle][RateLimiter] Add `rate_limiter` tag to rate limiter services --- rate_limiter.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rate_limiter.rst b/rate_limiter.rst index 7453e1e70bc..8c667dd3f59 100644 --- a/rate_limiter.rst +++ b/rate_limiter.rst @@ -215,6 +215,16 @@ at a rate of another 500 requests every 15 minutes. If you don't make that number of requests, the unused ones don't accumulate (the ``limit`` option prevents that number from being higher than 5,000). +.. tip:: + + All rate-limiters are tagged with the ``rate_limiter`` tag, so you can + easily find them with a tagged iterator or locator. + + .. versionadded:: 7.1 + + The automatic addition of the ``rate_limiter`` tag was introduced + in Symfony 7.1. + Rate Limiting in Action ----------------------- From e12c974d310d690472d9b67d062fa316dc2b5983 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 20 Dec 2023 08:49:58 +0100 Subject: [PATCH 86/99] [Validator] Add `list` and `associative_array` types to Type constraint --- reference/constraints/Type.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reference/constraints/Type.rst b/reference/constraints/Type.rst index 1bb4035c7fd..b8f41fbd524 100644 --- a/reference/constraints/Type.rst +++ b/reference/constraints/Type.rst @@ -190,6 +190,11 @@ PHP class/interface or a valid PHP datatype (checked by PHP's ``is_()`` function * :phpfunction:`resource ` * :phpfunction:`null ` +If you're dealing with arrays, you can use the following types in the constraint: + +* ``list`` which uses :phpfunction:`array_is_list ` internally +* ``associative_array`` which is true for any **non-empty** array that is not a list + Also, you can use ``ctype_*()`` functions from corresponding `built-in PHP extension`_. Consider `a list of ctype functions`_: @@ -208,6 +213,11 @@ Also, you can use ``ctype_*()`` functions from corresponding Make sure that the proper :phpfunction:`locale ` is set before using one of these. +.. versionadded:: 7.1 + + The ``list`` and ``associative_array`` types were introduced in Symfony + 7.1. + Finally, you can use aggregated functions: * ``number``: ``is_int || is_float && !is_nan`` From c7ac483dd76079af66756a35eb27ab401b72abd6 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 20 Dec 2023 09:14:11 +0100 Subject: [PATCH 87/99] fix typo --- http_client.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http_client.rst b/http_client.rst index 81e3b3068c9..530b2aeaf8f 100644 --- a/http_client.rst +++ b/http_client.rst @@ -1907,7 +1907,7 @@ in order when requests are made:: It is also possible to create a :class:`Symfony\\Component\\HttpClient\\Response\\MockResponse` directly -from a file, which is particularly useful when storing your responses +from a file, which is particularly useful when storing your response snapshots in files:: use Symfony\Component\HttpClient\Response\MockResponse; From 62aeccb52ec4ef5b6ea39aa0632c5c480ffda10d Mon Sep 17 00:00:00 2001 From: Alan ZARLI Date: Mon, 18 Dec 2023 16:36:01 +0100 Subject: [PATCH 88/99] [Notifier] Add Smsbox notifier bridge --- notifier.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notifier.rst b/notifier.rst index b57f501687d..a8f658cbe62 100644 --- a/notifier.rst +++ b/notifier.rst @@ -92,6 +92,7 @@ Service Package DSN `Sinch`_ ``symfony/sinch-notifier`` ``sinch://ACCOUNT_ID:AUTH_TOKEN@default?from=FROM`` `Smsapi`_ ``symfony/smsapi-notifier`` ``smsapi://TOKEN@default?from=FROM`` `SmsBiuras`_ ``symfony/sms-biuras-notifier`` ``smsbiuras://UID:API_KEY@default?from=FROM&test_mode=0`` +`Smsbox`_ ``symfony/smsbox-notifier`` ``smsbox://APIKEY@default?mode=MODE&strategy=STRATEGY&sender=SENDER`` `Smsc`_ ``symfony/smsc-notifier`` ``smsc://LOGIN:PASSWORD@default?from=FROM`` `SMSFactor`_ ``symfony/sms-factor-notifier`` ``sms-factor://TOKEN@default?sender=SENDER&push_type=PUSH_TYPE`` `SpotHit`_ ``symfony/spot-hit-notifier`` ``spothit://TOKEN@default?from=FROM`` @@ -245,7 +246,7 @@ Service Package D .. versionadded:: 7.1 - The ``Bluesky`` and ``Unifonic`` integrations were introduced in Symfony 7.1. + The ``Bluesky``, ``Unifonic`` and ``Smsbox`` integrations were introduced in Symfony 7.1. Chatters are configured using the ``chatter_transports`` setting: From 6eaf0d28c4a51d322a1f4dac9945cecf1c262d39 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 20 Dec 2023 15:44:04 +0100 Subject: [PATCH 89/99] Minor tweak --- rate_limiter.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rate_limiter.rst b/rate_limiter.rst index 8c667dd3f59..818660498a8 100644 --- a/rate_limiter.rst +++ b/rate_limiter.rst @@ -218,7 +218,8 @@ prevents that number from being higher than 5,000). .. tip:: All rate-limiters are tagged with the ``rate_limiter`` tag, so you can - easily find them with a tagged iterator or locator. + find them with a :doc:`tagged iterator ` or + :doc:`locator `. .. versionadded:: 7.1 From f32a8cf34775c2b509c2312a610213aa5de29291 Mon Sep 17 00:00:00 2001 From: Matthieu Lempereur Date: Wed, 20 Dec 2023 13:58:44 +0100 Subject: [PATCH 90/99] [Security] Update request matcher doc --- security/access_control.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/security/access_control.rst b/security/access_control.rst index 1da469a1f33..a8a0a3e2987 100644 --- a/security/access_control.rst +++ b/security/access_control.rst @@ -19,10 +19,10 @@ things: 1. Matching Options ------------------- -Symfony creates an instance of :class:`Symfony\\Component\\HttpFoundation\\RequestMatcher` -for each ``access_control`` entry, which determines whether or not a given -access control should be used on this request. The following ``access_control`` -options are used for matching: +Symfony uses :class:`Symfony\\Component\\HttpFoundation\\ChainRequestMatcher` for +each ``access_control`` entry, which determines which implementation of +:class:`Symfony\\Component\\HttpFoundation\\RequestMatcherInterface` should be used +on this request. The following ``access_control`` options are used for matching: * ``path``: a regular expression (without delimiters) * ``ip`` or ``ips``: netmasks are also supported (can be a comma-separated string) From 9f4b6263f317b38b9294a6d0622cc79ea6d598ae Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 21 Dec 2023 09:54:44 +0100 Subject: [PATCH 91/99] [String] Remove confusing paragraph about `withEmoji('strip')` --- components/intl.rst | 9 +++++++++ components/string.rst | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/components/intl.rst b/components/intl.rst index 46146e47e1b..8dde23105a6 100644 --- a/components/intl.rst +++ b/components/intl.rst @@ -424,6 +424,15 @@ platforms:: $transliterator->transliterate('Menus with πŸ₯— or πŸ§†'); // => 'Menus with :green_salad: or :falafel:' +Furthermore the ``EmojiTransliterator`` provides a special ``strip`` locale +that removes all the emojis from a string:: + + use Symfony\Component\Intl\Transliterator\EmojiTransliterator; + + $transliterator = EmojiTransliterator::create('strip'); + $transliterator->transliterate('πŸŽ‰Hey!πŸ₯³ 🎁Happy Birthday!🎁'); + // => 'Hey! Happy Birthday!' + .. tip:: Combine this emoji transliterator with the :ref:`Symfony String slugger ` diff --git a/components/string.rst b/components/string.rst index f743849fd19..b3d9bb7954b 100644 --- a/components/string.rst +++ b/components/string.rst @@ -589,16 +589,6 @@ from GitHub or Slack, use the first argument of ``withEmoji()`` method:: $slug = $slugger->slug('a 😺, πŸˆβ€β¬›, and a 🦁'); // $slug = 'a-smiley-cat-black-cat-and-a-lion'; -If you want to strip emojis from slugs, use the special ``strip`` locale:: - - use Symfony\Component\String\Slugger\AsciiSlugger; - - $slugger = new AsciiSlugger(); - $slugger = $slugger->withEmoji('strip'); - - $slug = $slugger->slug('a 😺, πŸˆβ€β¬›, and a 🦁'); - // $slug = 'a-and-a'; - .. _string-inflector: Inflector From 8d69319ff59ef8ae2498469e405289c5bbdb604c Mon Sep 17 00:00:00 2001 From: Matthieu Lempereur Date: Sat, 23 Dec 2023 18:37:12 +0100 Subject: [PATCH 92/99] Remove reference to some removed classes --- create_framework/http_kernel_httpkernel_class.rst | 5 ----- introduction/from_flat_php_to_symfony.rst | 11 +++++------ messenger.rst | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/create_framework/http_kernel_httpkernel_class.rst b/create_framework/http_kernel_httpkernel_class.rst index fa673f9ba57..ecf9d4c7879 100644 --- a/create_framework/http_kernel_httpkernel_class.rst +++ b/create_framework/http_kernel_httpkernel_class.rst @@ -114,11 +114,6 @@ client; that's what the ``ResponseListener`` does:: $dispatcher->addSubscriber(new HttpKernel\EventListener\ResponseListener('UTF-8')); -If you want out of the box support for streamed responses, subscribe -to ``StreamedResponseListener``:: - - $dispatcher->addSubscriber(new HttpKernel\EventListener\StreamedResponseListener()); - And in your controller, return a ``StreamedResponse`` instance instead of a ``Response`` instance. diff --git a/introduction/from_flat_php_to_symfony.rst b/introduction/from_flat_php_to_symfony.rst index 7386f629546..3ae6a16d8a3 100644 --- a/introduction/from_flat_php_to_symfony.rst +++ b/introduction/from_flat_php_to_symfony.rst @@ -240,7 +240,7 @@ the ``templates/layout.php``: You now have a setup that will allow you to reuse the layout. Unfortunately, to accomplish this, you're forced to use a few ugly PHP functions (``ob_start()``, ``ob_get_clean()``) in the template. Symfony -solves this using a `Templating`_ component. You'll see it in action shortly. +solves this using `Twig`_. You'll see it in action shortly. Adding a Blog "show" Page ------------------------- @@ -568,9 +568,8 @@ nice way to group related pages. The controller functions are also sometimes cal The two controllers (or actions) are still lightweight. Each uses the :doc:`Doctrine ORM library ` to retrieve objects from the -database and the Templating component to render a template and return a -``Response`` object. The ``list.html.twig`` template is now quite a bit simpler, -and uses Twig: +database and Twig to render a template and return a ``Response`` object. +The ``list.html.twig`` template is now quite a bit simpler, and uses Twig: .. code-block:: html+twig @@ -677,7 +676,7 @@ migrating the blog from flat PHP to Symfony has improved your life: :doc:`routing `, or rendering :doc:`controllers `; * Symfony gives you **access to open source tools** such as `Doctrine`_ and the - `Templating`_, :doc:`Security `, :doc:`Form `, + `Twig`_, :doc:`Security `, :doc:`Form `, `Validator`_ and `Translation`_ components (to name a few); * The application now enjoys **fully-flexible URLs** thanks to the Routing @@ -694,7 +693,7 @@ A good selection of `Symfony community tools`_ can be found on GitHub. .. _`Model-View-Controller`: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller .. _`Doctrine`: https://www.doctrine-project.org/ -.. _Templating: https://github.com/symfony/templating +.. _Twig: https://github.com/twigphp/twig .. _Translation: https://github.com/symfony/translation .. _`Composer`: https://getcomposer.org .. _`download Composer`: https://getcomposer.org/download/ diff --git a/messenger.rst b/messenger.rst index 5d620fde6a4..bdd74c4750a 100644 --- a/messenger.rst +++ b/messenger.rst @@ -2381,7 +2381,7 @@ will not be rolled back. If ``WhenUserRegisteredThenSendWelcomeEmail`` throws an exception, that exception will be wrapped into a ``DelayedMessageHandlingException``. Using - ``DelayedMessageHandlingException::getExceptions`` will give you all + ``DelayedMessageHandlingException::getWrappedExceptions`` will give you all exceptions that are thrown while handling a message with the ``DispatchAfterCurrentBusStamp``. From 436f69e60f3177827ffb162bd48824433dd2acc5 Mon Sep 17 00:00:00 2001 From: Thomas Durand Date: Thu, 14 Dec 2023 15:41:19 +0100 Subject: [PATCH 93/99] [HttpClient] Add `HttpOptions::addHeader` method --- http_client.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/http_client.rst b/http_client.rst index 2ca591a5098..b76c8e25199 100644 --- a/http_client.rst +++ b/http_client.rst @@ -150,10 +150,17 @@ brings most of the available options with type-hinted getters and setters:: $this->client = $client->withOptions( (new HttpOptions()) ->setBaseUri('https://...') + // setHeaders() replaces *all* headers at once, and deletes the headers you do not provide ->setHeaders(['header-name' => 'header-value']) + // add or replace a single header using addHeader() + ->addHeader('another-header-name', 'another-header-value') ->toArray() ); +.. versionadded:: 7.1 + + The :method:`Symfony\\Component\\HttpClient\\HttpOptions::addHeader` method was introduced in Symfony 7.1. + Some options are described in this guide: * `Authentication`_ From e9c7ec718bd2842d30d8886880a2ad43229dc767 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 26 Dec 2023 21:54:15 +0100 Subject: [PATCH 94/99] - --- http_client.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/http_client.rst b/http_client.rst index dc316fb09dc..09c8aaa28b6 100644 --- a/http_client.rst +++ b/http_client.rst @@ -150,7 +150,7 @@ brings most of the available options with type-hinted getters and setters:: $this->client = $client->withOptions( (new HttpOptions()) ->setBaseUri('https://...') - // setHeaders() replaces *all* headers at once, and deletes the headers you do not provide + // replaces *all* headers at once, and deletes the headers you do not provide ->setHeaders(['header-name' => 'header-value']) // add or replace a single header using addHeader() ->addHeader('another-header-name', 'another-header-value') @@ -159,7 +159,8 @@ brings most of the available options with type-hinted getters and setters:: .. versionadded:: 7.1 - The :method:`Symfony\\Component\\HttpClient\\HttpOptions::addHeader` method was introduced in Symfony 7.1. + The :method:`Symfony\\Component\\HttpClient\\HttpOptions::addHeader` + method was introduced in Symfony 7.1. Some options are described in this guide: From fc23fa3625a421d0710638ec493e7c4e8c81ef34 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 26 Dec 2023 21:59:30 +0100 Subject: [PATCH 95/99] Add missing link --- notifier.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/notifier.rst b/notifier.rst index c58c777887e..e68ca298bda 100644 --- a/notifier.rst +++ b/notifier.rst @@ -1002,6 +1002,7 @@ is dispatched. Listeners receive a .. _`Slack`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Slack/README.md .. _`Sms77`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Sms77/README.md .. _`SmsBiuras`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/SmsBiuras/README.md +.. _`Smsbox`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Smsbox/README.md .. _`Smsapi`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Smsapi/README.md .. _`Smsc`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Smsc/README.md .. _`SpotHit`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/SpotHit/README.md From 2a8e749d28a630a167a8f86d50b81fa6722c9deb Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 26 Dec 2023 21:59:55 +0100 Subject: [PATCH 96/99] - --- notifier.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notifier.rst b/notifier.rst index e68ca298bda..663398a5c0c 100644 --- a/notifier.rst +++ b/notifier.rst @@ -246,7 +246,8 @@ Service Package D .. versionadded:: 7.1 - The ``Bluesky``, ``Unifonic`` and ``Smsbox`` integrations were introduced in Symfony 7.1. + The ``Bluesky``, ``Unifonic`` and ``Smsbox`` integrations + were introduced in Symfony 7.1. Chatters are configured using the ``chatter_transports`` setting: From 35e2703636f49277122c1d158d3c989e930cd6be Mon Sep 17 00:00:00 2001 From: Franklin LIA <46316603+lbbyf@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:51:26 +0100 Subject: [PATCH 97/99] Update routing.rst In Symfony version 7, we don't have a loader for the annotations --- routing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.rst b/routing.rst index 77b035ddd16..941c074cb0d 100644 --- a/routing.rst +++ b/routing.rst @@ -2600,7 +2600,7 @@ same URL, but with the HTTPS scheme. If you want to force a group of routes to use HTTPS, you can define the default scheme when importing them. The following example forces HTTPS on all routes -defined as annotations: +defined as attributes: .. configuration-block:: From bc95bcc4e0df59e662366c9809f636c82a5964a8 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 27 Dec 2023 09:45:56 +0100 Subject: [PATCH 98/99] Rename `addHeader` to `setHeader` --- http_client.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http_client.rst b/http_client.rst index 09c8aaa28b6..1966dfba064 100644 --- a/http_client.rst +++ b/http_client.rst @@ -152,14 +152,14 @@ brings most of the available options with type-hinted getters and setters:: ->setBaseUri('https://...') // replaces *all* headers at once, and deletes the headers you do not provide ->setHeaders(['header-name' => 'header-value']) - // add or replace a single header using addHeader() - ->addHeader('another-header-name', 'another-header-value') + // set or replace a single header using addHeader() + ->setHeader('another-header-name', 'another-header-value') ->toArray() ); .. versionadded:: 7.1 - The :method:`Symfony\\Component\\HttpClient\\HttpOptions::addHeader` + The :method:`Symfony\\Component\\HttpClient\\HttpOptions::setHeader` method was introduced in Symfony 7.1. Some options are described in this guide: From 0572d4b68bb1d73239390cc78e0788d89eb79add Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 27 Dec 2023 20:21:30 +0700 Subject: [PATCH 99/99] Document `#[WithHttpStatus]` and `#[WithLogLevel]` on interfaces. --- reference/configuration/framework.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 894cf7a82c5..92a8f399478 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -3806,6 +3806,11 @@ the ``#[WithLogLevel]`` attribute:: { } +``#[WithHttpStatus]`` and ``#[WithLogLevel]`` attributes also work with parent +classes and (since 7.1) interfaces. To find the effective HTTP status and log +level, the framework will look on the parent hierarchy first, starting on the +immediate parent, then it will look on the interfaces. + .. _`HTTP Host header attacks`: https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html .. _`Security Advisory Blog post`: https://symfony.com/blog/security-releases-symfony-2-0-24-2-1-12-2-2-5-and-2-3-3-released#cve-2013-4752-request-gethost-poisoning .. _`phpstorm-url-handler`: https://github.com/sanduhrs/phpstorm-url-handler