From af5401a38a622e0cc55b42eca361ae7061852f9b Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Tue, 18 Aug 2020 17:44:19 +0200 Subject: [PATCH 0001/5386] Remove manual enabling of validation and validator annotations --- validation.rst | 72 +------------------------------------------------- 1 file changed, 1 insertion(+), 71 deletions(-) diff --git a/validation.rst b/validation.rst index fd18f003d56..de6cfb755a3 100644 --- a/validation.rst +++ b/validation.rst @@ -207,77 +207,7 @@ Inside the template, you can output the list of errors exactly as needed: Configuration ------------- -Before using the Symfony validator, make sure it's enabled in the main config -file: - -.. configuration-block:: - - .. code-block:: yaml - - # config/packages/framework.yaml - framework: - validation: { enabled: true } - - .. code-block:: xml - - - - - - - - - - - .. code-block:: php - - // config/packages/framework.php - $container->loadFromExtension('framework', [ - 'validation' => [ - 'enabled' => true, - ], - ]); - -Besides, if you plan to use annotations to configure validation, replace the -previous configuration by the following: - -.. configuration-block:: - - .. code-block:: yaml - - # config/packages/framework.yaml - framework: - validation: { enable_annotations: true } - - .. code-block:: xml - - - - - - - - - - - .. code-block:: php - - // config/packages/framework.php - $container->loadFromExtension('framework', [ - 'validation' => [ - 'enable_annotations' => true, - ], - ]); +In the previous Symfony versions, enabling the validator in configuration was a requirement. It's not the case anymore, the validation is enabled by default as long as the Validator component is installed. In the same way, annotations are enabled by default if ``doctrine/annotations`` is installed. .. tip:: From f41ef122c26ec0bb532dab399d2ba4c9f93af8eb Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 30 May 2020 15:42:21 +0200 Subject: [PATCH 0002/5386] [HttpClient] add doc about extending and AsyncDecoratorTrait --- http_client.rst | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/http_client.rst b/http_client.rst index 42a4b0388da..7c4c50932ae 100644 --- a/http_client.rst +++ b/http_client.rst @@ -1322,6 +1322,110 @@ This allows using them where native PHP streams are needed:: // later on if you need to, you can access the response from the stream $response = stream_get_meta_data($streamResource)['wrapper_data']->getResponse(); +Extensibility +------------- + +In order to extend the behavior of a base HTTP client, decoration is the way to go:: + + class MyExtendedHttpClient implements HttpClientInterface + { + private $decoratedClient; + + public function __construct(HttpClientInterface $decoratedClient = null) + { + $this->decoratedClient = $decoratedClient ?? HttpClient::create(); + } + + public function request(string $method, string $url, array $options = []): ResponseInterface + { + // do what you want here with $method, $url and/or $options + + $response = $this->decoratedClient->request(); + + //!\ calling any method on $response here would break async, see below for a better way + + return $response; + } + + public function stream($responses, float $timeout = null): ResponseStreamInterface + { + return $this->decoratedClient->stream($responses, $timeout); + } + } + +A decorator like this one is suited for use cases where processing the +requests' arguments is enough. + +By decorating the ``on_progress`` option, one can +even implement basic monitoring of the response. But since calling responses' +methods forces synchronous operations, doing so in ``request()`` breaks async. +The solution then is to also decorate the response object itself. +:class:`Symfony\\Component\\HttpClient\\TraceableHttpClient` and +:class:`Symfony\\Component\\HttpClient\\Response\\TraceableResponse` are good +examples as a starting point. + +.. versionadded:: 5.2 + + ``AsyncDecoratorTrait`` was introduced in Symfony 5.2. + +In order to help writing more advanced response processors, the component provides +an :class:`Symfony\\Component\\HttpClient\\AsyncDecoratorTrait`. This trait allows +processing the stream of chunks as they come back from the network:: + + class MyExtendedHttpClient implements HttpClientInterface + { + use AsyncDecoratorTrait; + + public function request(string $method, string $url, array $options = []): ResponseInterface + { + // do what you want here with $method, $url and/or $options + + $passthru = function (ChunkInterface $chunk, AsyncContext $context) { + + // do what you want with chunks, e.g. split them + // in smaller chunks, group them, skip some, etc. + + yield $chunk; + }; + + return new AsyncResponse($this->client, $method, $url, $options, $passthru); + } + } + +Because the trait already implements a constructor and the ``stream()`` method, +you don't need to add them. The ``request()`` method should still be defined; +it shall return an +:class:`Symfony\\Component\\HttpClient\\Response\\AsyncResponse`. + +The custom processing of chunks should happen in ``$passthru``: this generator +is where you need to write your logic. It will be called for each chunk yielded by +the underlying client. A ``$passthru`` that does nothing would just ``yield $chunk;``. +Of course, you could also yield a modified chunk, split the chunk into many +ones by yielding several times, or even skip a chunk altogether by issuing a +``return;`` instead of yielding. + +In order to control the stream, the chunk passthru receives an +:class:`Symfony\\Component\\HttpClient\\Response\\AsyncContext` as second +argument. This context object has methods to read the current state of the +response. It also allows altering the response stream with methods to create new +chunks of content, pause the stream, cancel the stream, change the info of the +response, replace the current request by another one or change the chunk passthru +itself. + +Checking the test cases implemented in +:class:`Symfony\\Component\\HttpClient\\Response\\Tests\\AsyncDecoratorTraitTest` +might be a good start to get various working examples for a better understanding. +Here are the use cases that it simulates: + +* retry a failed request; +* send a preflight request, e.g. for authentication needs; +* issue subrequests and include their content in the main response's body. + +The logic in :class:`Symfony\\Component\\HttpClient\\Response\\AsyncResponse` has +many safety checks that will throw a ``LogicException`` if the chunk passthru +doesn't behave correctly; e.g. if a chunk is yielded after an ``isLast()`` one, +or if a content chunk is yielded before an ``isFirst()`` one, etc. + Testing HTTP Clients and Responses ---------------------------------- From 9994e7b0dca329678cb7db549bbae7d256d9c7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Wed, 21 Oct 2020 20:24:19 +0200 Subject: [PATCH 0003/5386] Use APP_RUNTIME_ENV to define secrets --- configuration/secrets.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configuration/secrets.rst b/configuration/secrets.rst index 696ce519682..ab49c052dff 100644 --- a/configuration/secrets.rst +++ b/configuration/secrets.rst @@ -48,7 +48,7 @@ running: .. code-block:: terminal - $ php bin/console secrets:generate-keys --env=prod + $ APP_RUNTIME_ENV=prod php bin/console secrets:generate-keys This will generate ``config/secrets/prod/prod.encrypt.public.php`` and ``config/secrets/prod/prod.decrypt.private.php``. @@ -78,7 +78,7 @@ Suppose you want to store your database password as a secret. By using the $ php bin/console secrets:set DATABASE_PASSWORD # set your production value - $ php bin/console secrets:set DATABASE_PASSWORD --env=prod + $ APP_RUNTIME_ENV=prod php bin/console secrets:set DATABASE_PASSWORD This will create a new file for the secret in ``config/secrets/dev`` and another in ``config/secrets/prod``. You can also set the secret in a few other ways: @@ -253,7 +253,7 @@ your secrets during deployment to the "local" vault: .. code-block:: terminal - $ php bin/console secrets:decrypt-to-local --force --env=prod + $ APP_RUNTIME_ENV=prod php bin/console secrets:decrypt-to-local --force This will write all the decrypted secrets into the ``.env.prod.local`` file. After doing this, the decryption key does *not* need to remain on the server(s). From 1b5e8dc6610f5856b31ebf798801ca4cab6ca1ce Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Sat, 2 Jan 2021 19:01:18 +0100 Subject: [PATCH 0004/5386] Documented setTty and setPty --- components/process.rst | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/components/process.rst b/components/process.rst index b7845145ca3..0a53b021c91 100644 --- a/components/process.rst +++ b/components/process.rst @@ -352,6 +352,35 @@ The input of a process can also be defined using `PHP streams`_:: // will echo: 'foobar' echo $process->getOutput(); +Using TTY and PTY Modes +----------------------- + +All examples above show that your program has control over the input of a +process (using ``setInput()``) and the output from that process (using +``getOutput()``). The Process component has two special modes that tweak +the relationship between your program and the process: teletype (tty) and +pseudo-teletype (pty). + +In TTY mode, you connect the input and output of the process to the input +and output of your program. This allows for instance to open an editor like +Vim or Nano as a process. You enable TTY mode by calling +:method:`Symfony\\Component\\Process\\Process::setTty`:: + + $process = new Process(['vim']); + $process->setTty(true); + $process->run(); + + // As the output is connected to the terminal, it is no longer possible + // to read or modify the output from the process! + dump($process->getOutput()); // null + +In PTY mode, your program behaves as a terminal for the process instead of +a plain input and output. Some programs behave differently when +interacting with a real terminal instead of another program. For instance, +some programs prompt for a password when talking with a terminal. Use +:method:`Symfony\\Component\\Process\\Process::setPty` to enable this +mode. + Stopping a Process ------------------ @@ -483,7 +512,6 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and However, it is possible to pass a callback to the ``start``, ``run`` or ``mustRun`` methods to handle process output in a streaming fashion. - Finding an Executable --------------------- From d75a175462ff9f8ac8ee411d66ff59d7ad6e6690 Mon Sep 17 00:00:00 2001 From: Boris Sondagh Date: Mon, 18 Jan 2021 15:27:48 +0100 Subject: [PATCH 0005/5386] Update best_practices.rst --- bundles/best_practices.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bundles/best_practices.rst b/bundles/best_practices.rst index 696c9da58ff..80e13b8b10b 100644 --- a/bundles/best_practices.rst +++ b/bundles/best_practices.rst @@ -25,6 +25,7 @@ namespace short name, which must end with ``Bundle``. A namespace becomes a bundle as soon as you add a bundle class to it. The bundle class name must follow these rules: +* Extend Symfony\Component\HttpKernel\Bundle\Bundle * Use only alphanumeric characters and underscores; * Use a StudlyCaps name (i.e. camelCase with an uppercase first letter); * Use a descriptive and short name (no more than two words); @@ -41,9 +42,6 @@ Namespace Bundle Class Name ``Acme\BlogBundle`` AcmeBlogBundle ========================== ================== -By convention, the ``getName()`` method of the bundle class should return the -class name. - .. note:: If you share your bundle publicly, you must use the bundle class name as From e73e9231bd9276372171857720037376849596d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Michael=20O=2E=20Hegg=C3=B8?= Date: Wed, 27 Jan 2021 22:10:28 +0100 Subject: [PATCH 0006/5386] [Messenger] More on unique Redis consumer names --- messenger.rst | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/messenger.rst b/messenger.rst index 45499c14490..733365c3800 100644 --- a/messenger.rst +++ b/messenger.rst @@ -619,7 +619,18 @@ times: process_name=%(program_name)s_%(process_num)02d Change the ``async`` argument to use the name of your transport (or transports) -and ``user`` to the Unix user on your server. Next, tell Supervisor to read your +and ``user`` to the Unix user on your server. + +If you use the Redis Transport, note that each worker needs a unique consumer name to +avoid the same message being handled by multiple workers. One way to achieve this is +to set an environment variable in the Supervisor configuration file, which you can +then refer to in `messenger.yaml` (see Redis section above): + +.. code-block:: ini + + environment=MESSENGER_CONSUMER_NAME=%(program_name)s_%(process_num)02d + +Next, tell Supervisor to read your config and start your workers: .. code-block:: terminal @@ -1209,9 +1220,13 @@ claim_interval Interval on which pending/abandoned ``60000`` (1 Minute) .. caution:: There should never be more than one ``messenger:consume`` command running with the same - config (stream, group and consumer name) to avoid having a message handled more than once. - Using the ``HOSTNAME`` as the consumer might often be a good idea. In case you are using - Kubernetes to orchestrate your containers, consider using a ``StatefulSet``. + combination of ``stream``, ``group`` and ``consumer``, or messages could end up being + handled more than once. If you run multiple queue workers, ``consumer` can be set to an + environment variable (like ``%env(MESSENGER_CONSUMER_NAME)%`)` set by Supervisor + (example below) or whatever service used to manage the worker processes. + In a container environment, the ``HOSTNAME`` can be used as the consumer name, since + there is only one worker per container/host. If using Kubernetes to orchestrate the + containers, consider using a ``StatefulSet`` to have stable names. .. tip:: From 243d84b030e6fbbc09bdc447bd01c6f49fc7d777 Mon Sep 17 00:00:00 2001 From: Johann Pardanaud Date: Thu, 11 Feb 2021 16:33:02 +0100 Subject: [PATCH 0007/5386] [Messenger] Document DSN format for Redis Cluster --- messenger.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/messenger.rst b/messenger.rst index c53044e588d..edcd236f2c3 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1190,6 +1190,8 @@ The Redis transport DSN may looks like this: MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages # Full DSN Example MESSENGER_TRANSPORT_DSN=redis://password@localhost:6379/messages/symfony/consumer?auto_setup=true&serializer=1&stream_max_entries=0&dbindex=0 + # Redis Cluster Example + MESSENGER_TRANSPORT_DSN=redis://host-01:6379,redis://host-02:6379,redis://host-03:6379,redis://host-04:6379 # Unix Socket Example MESSENGER_TRANSPORT_DSN=redis:///var/run/redis.sock From 6f1a420a567338648e66a788927b0ef02df8460b Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Sun, 14 Feb 2021 10:09:45 +0100 Subject: [PATCH 0008/5386] [Validator] Improve Valid constraint description --- reference/constraints/Valid.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/constraints/Valid.rst b/reference/constraints/Valid.rst index 1cb992128ac..b052cab38b4 100644 --- a/reference/constraints/Valid.rst +++ b/reference/constraints/Valid.rst @@ -243,6 +243,13 @@ the validation of the ``Address`` fields failed. App\Entity\Author.address.zipCode: This value is too long. It should have 5 characters or less. +.. include:: /reference/constraints/_empty-values-are-valid.rst.inc + +.. note:: + + This constraint is not aware what sub-object must be associated with it, a common solution is to combine this constraint + with :doc:`Type `. + Options ------- From a74de75dde9029e83192bfe156272c71f01e4891 Mon Sep 17 00:00:00 2001 From: Thijs-jan Veldhuizen Date: Wed, 17 Feb 2021 15:53:19 +0100 Subject: [PATCH 0009/5386] Update monolog_console.rst --- logging/monolog_console.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/logging/monolog_console.rst b/logging/monolog_console.rst index 5c0263c5349..21c67d705d8 100644 --- a/logging/monolog_console.rst +++ b/logging/monolog_console.rst @@ -67,6 +67,16 @@ the console. If they are displayed, they are timestamped and colored appropriate Additionally, error logs are written to the error output (``php://stderr``). There is no need to conditionally handle the verbosity settings anymore. +=============== ======================================= ============ +LoggerInterface Verbosity Command line +=============== ======================================= ============ +->error() OutputInterface::VERBOSITY_QUIET stderr +->warning() OutputInterface::VERBOSITY_NORMAL stdout +->notice() OutputInterface::VERBOSITY_VERBOSE -v +->info() OutputInterface::VERBOSITY_VERY_VERBOSE -vv +->debug() OutputInterface::VERBOSITY_DEBUG -vvv +=============== ======================================= ============ + The Monolog console handler is enabled by default: .. configuration-block:: From c4a398e55598cef9f2bc4557cfa1e0a12ff98e1d Mon Sep 17 00:00:00 2001 From: wkania Date: Mon, 22 Feb 2021 21:46:34 +0100 Subject: [PATCH 0010/5386] [Validator][Translation] Mention symfony/translation --- validation/translations.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/validation/translations.rst b/validation/translations.rst index 5c22f9362c3..3edc15dab5e 100644 --- a/validation/translations.rst +++ b/validation/translations.rst @@ -8,6 +8,11 @@ If you're using validation constraints with the Form component, you can translat the error messages by creating a translation resource for the ``validators`` :ref:`domain `. +.. note:: + + In order to translate the error message, you should have installed the + symfony/translation component with Composer. + To start, suppose you've created a plain-old-PHP object that you need to use somewhere in your application:: @@ -93,7 +98,7 @@ Now, create a ``validators`` catalog file in the ``translations/`` directory: .. code-block:: xml - + @@ -108,12 +113,12 @@ Now, create a ``validators`` catalog file in the ``translations/`` directory: .. code-block:: yaml - # translations/validators.en.yaml + # translations/validators/validators.en.yaml author.name.not_blank: Please enter an author name. .. code-block:: php - // translations/validators.en.php + // translations/validators/validators.en.php return [ 'author.name.not_blank' => 'Please enter an author name.', ]; From 2d2f3b7cbdbea6b805212c8dc21bdd02966aebcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Isaert?= Date: Mon, 21 Dec 2020 19:43:42 +0100 Subject: [PATCH 0011/5386] [Cache] Add TLS scheme for Redis connection See https://github.com/symfony/symfony/pull/39599 --- components/cache/adapters/redis_adapter.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/cache/adapters/redis_adapter.rst b/components/cache/adapters/redis_adapter.rst index 935afcd9f92..f1d00b248c2 100644 --- a/components/cache/adapters/redis_adapter.rst +++ b/components/cache/adapters/redis_adapter.rst @@ -62,7 +62,8 @@ helper method allows creating and configuring the Redis client class instance us ); The DSN can specify either an IP/host (and an optional port) or a socket path, as well as a -password and a database index. +password and a database index. To enable TLS for connections, the scheme ``redis`` must be +replaced by ``rediss``. .. note:: @@ -70,7 +71,7 @@ password and a database index. .. code-block:: text - redis://[pass@][ip|host|socket[:port]][/db-index] + redis[s]://[pass@][ip|host|socket[:port]][/db-index] Below are common examples of valid DSNs showing a combination of available values:: From e3328a46d4f8b03f9a4a9f6fbbf9b2ba33554518 Mon Sep 17 00:00:00 2001 From: Thibault RICHARD Date: Sun, 28 Feb 2021 21:51:40 +0100 Subject: [PATCH 0012/5386] [Encore] Deploying to a CDN subdirectory --- frontend/encore/cdn.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/encore/cdn.rst b/frontend/encore/cdn.rst index a7a2884c13a..17df7ffce21 100644 --- a/frontend/encore/cdn.rst +++ b/frontend/encore/cdn.rst @@ -39,6 +39,10 @@ pages also use the CDN. Fortunately, the :ref:`entrypoints.json ` paths are updated to include the full URL to the CDN. +When deploying to a subdirectory of your CDN, you must add the path at the end of your URL - +e.g. ``Encore.setPublicPath('https://my-cool-app.com.global.prod.fastly.net/awesome-website')`` +will generate assets URLs like ``https://my-cool-app.com.global.prod.fastly.net/awesome-website/dashboard.js`` + If you are using ``Encore.enableIntegrityHashes()`` and your CDN and your domain are not the `same-origin`_, you may need to set the ``crossorigin`` option in your webpack_encore.yaml configuration to ``anonymous`` or ``use-credentials`` From d1190fcfafecb4ee29f8a59fa77210a0b9822799 Mon Sep 17 00:00:00 2001 From: William Pinaud Date: Sat, 6 Mar 2021 15:51:38 +0100 Subject: [PATCH 0013/5386] Added doc and defaults for missing 'ttl' option in config Hi, this might need validation, but I stumbled upon a difference between what the doc says (4.4+) and what's in https://github.com/symfony/http-foundation/blob/5.x/Session/Storage/Handler/RedisSessionHandler.php. I think the 'ttl' option is unexplained and undocumented since it was added in 2019: https://github.com/symfony/http-foundation/commit/0c5217a9050712a1e66f851d04962abf8f2c6fc4 --- session/database.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/session/database.rst b/session/database.rst index a0fb1b3d4a6..f7a5b002dbb 100644 --- a/session/database.rst +++ b/session/database.rst @@ -89,9 +89,10 @@ and ``RedisProxy``: Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler: arguments: - '@Redis' - # you can optionally pass an array of options. The only option is 'prefix', - # which defines the prefix to use for the keys to avoid collision on the Redis server - # - { prefix: 'my_prefix' } + # you can optionally pass an array of options. The only options are 'prefix' and 'ttl', + # which define the prefix to use for the keys to avoid collision on the Redis server + # and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null: + # - { 'prefix' => 'my_prefix', 'ttl' => 600 } .. code-block:: xml @@ -99,8 +100,9 @@ and ``RedisProxy``: - @@ -116,9 +118,10 @@ and ``RedisProxy``: ->register(RedisSessionHandler::class) ->addArgument( new Reference('Redis'), - // you can optionally pass an array of options. The only option is 'prefix', - // which defines the prefix to use for the keys to avoid collision on the Redis server: - // ['prefix' => 'my_prefix'], + // you can optionally pass an array of options. The only options are 'prefix' and 'ttl', + // which define the prefix to use for the keys to avoid collision on the Redis server + // and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null: + // ['prefix' => 'my_prefix', 'ttl' => 600], ); Next, use the :ref:`handler_id ` From 070c9bb8781d956ba645442e1b71781a79e51044 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Sun, 7 Mar 2021 11:20:51 +0100 Subject: [PATCH 0014/5386] add a warning about object as extra parameter in route --- routing.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routing.rst b/routing.rst index 86defd2bafc..7c852af98da 100644 --- a/routing.rst +++ b/routing.rst @@ -1880,6 +1880,14 @@ use the ``generateUrl()`` helper:: // the 'blog' route only defines the 'page' parameter; the generated URL is: // /blog/2?category=Symfony +.. caution:: + + While objects are converted to string when used as placeholders, they are not + converted when used as extra parameters. So, if you're passing an object (e.g. an Uuid) + as value of an extra parameter, you need to explictly convert it to a string:: + + $this->generateUrl('blog', ['uuid' => (string) $entity->getUuid())] + If your controller does not extend from ``AbstractController``, you'll need to :ref:`fetch services in your controller ` and follow the instructions of the next section. From db79f2a9e6f0ce0d4c485fe21df43fdc68470990 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Sun, 7 Mar 2021 11:23:33 +0100 Subject: [PATCH 0015/5386] [Framework] Fix reference to default_path --- reference/configuration/framework.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 246726e820c..ada92f8f25e 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -2223,7 +2223,7 @@ paths This option allows to define an array of paths where the component will look for translation files. The later a path is added, the more priority it has (translations from later paths overwrite earlier ones). Translations from the -`default_path ` have more priority than +:ref:`default_path ` have more priority than translations from all these paths. .. _reference-translator-default_path: From 97a164daa87d81ede8e5f954a32d1af52f0c2408 Mon Sep 17 00:00:00 2001 From: mostefamed Date: Tue, 9 Mar 2021 11:17:02 +0100 Subject: [PATCH 0016/5386] Fix the matched path value During the test of the example, I didn't get the expected result when calling /blog --- routing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.rst b/routing.rst index 86defd2bafc..3fc50a8f5d7 100644 --- a/routing.rst +++ b/routing.rst @@ -1264,7 +1264,7 @@ the common configuration using options when importing the routes. was introduced in Symfony 4.4. In this example, the route of the ``index()`` action will be called ``blog_index`` -and its URL will be ``/blog/``. The route of the ``show()`` action will be called +and its URL will be ``/blog/{_locale}``. The route of the ``show()`` action will be called ``blog_show`` and its URL will be ``/blog/{_locale}/posts/{slug}``. Both routes will also validate that the ``_locale`` parameter matches the regular expression defined in the class annotation. From d59c1c8fdcdff10bc2b2cbd99a73d04261e79d93 Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Fri, 12 Mar 2021 00:00:46 +0100 Subject: [PATCH 0017/5386] Update debug.rst --- reference/configuration/debug.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reference/configuration/debug.rst b/reference/configuration/debug.rst index 86aed3b7ba6..33a6c656537 100644 --- a/reference/configuration/debug.rst +++ b/reference/configuration/debug.rst @@ -67,9 +67,10 @@ dump_destination Configures the output destination of the dumps. -By default, the dumps are shown in the toolbar. Since this is not always -possible (e.g. when working on a JSON API), you can have an alternate output -destination for dumps. Typically, you would set this to ``php://stderr``: +By default, dumps are shown in the WebDebugToolbar when returning HTML. +Since this is not always possible (e.g. when working on a JSON API), +you can have an alternate output destination for dumps. +Typically, you would set this to ``php://stderr``: .. configuration-block:: From ce6cdbe33c5f01b36a2486fdfb649bc8e6bf48e2 Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Fri, 12 Mar 2021 00:06:40 +0100 Subject: [PATCH 0018/5386] Update kernel.rst --- reference/configuration/kernel.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/kernel.rst b/reference/configuration/kernel.rst index 6b0ac4279ad..5cb1f8ea781 100644 --- a/reference/configuration/kernel.rst +++ b/reference/configuration/kernel.rst @@ -5,7 +5,7 @@ Configuring in the Kernel ========================= Some configuration can be done on the kernel class itself (located by default at -``src/Kernel.php``). You can do this by overriding specific methods in +``src/Kernel.php``). You can do this by overriding specific methods of the parent :class:`Symfony\\Component\\HttpKernel\\Kernel` class. Configuration From 1ad9effde7927b35af83c1fb3b6981c65308fee9 Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Fri, 12 Mar 2021 00:15:50 +0100 Subject: [PATCH 0019/5386] Update events.rst --- reference/events.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/events.rst b/reference/events.rst index 900d40eb12c..c55bfdcc824 100644 --- a/reference/events.rst +++ b/reference/events.rst @@ -1,10 +1,11 @@ Built-in Symfony Events ======================= -During the handling of an HTTP request, the Symfony framework (or any +The Symfony framework is an HTTP Request-Response one. +During the handling of an HTTP request, the framework (or any application using the :doc:`HttpKernel component `) dispatches some :doc:`events ` which you can use to modify -how the request is handled. +how the request is handled and how the response is returned. Kernel Events ------------- From ad6075bf1770d43a8dd71b38bdce5b57bdcf05bf Mon Sep 17 00:00:00 2001 From: mostefamed Date: Sat, 13 Mar 2021 20:23:19 +0100 Subject: [PATCH 0020/5386] Update definitions.rst Rename the returned variable from setArgument method and the assigned variable to addArgument method --- service_container/definitions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service_container/definitions.rst b/service_container/definitions.rst index f90a185e1c5..1107413cf99 100644 --- a/service_container/definitions.rst +++ b/service_container/definitions.rst @@ -92,10 +92,10 @@ fetched from the container:: // adds a new argument with the name of the argument // $argumentName = the name of the argument in the constructor - $argument = $definition->setArgument('$argumentName', $argumentValue); + $definition = $definition->setArgument('$argumentName', $argumentValue); // adds a new argument - $definition->addArgument($argument); + $definition->addArgument($argumentValue); // replaces argument on a specific index (0 = first argument) $definition->replaceArgument($index, $argument); From 068b20e5bb83ebd9f5c15cca2004ebe60db8c4bb Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Sun, 14 Mar 2021 11:06:51 +0100 Subject: [PATCH 0021/5386] [Serializer] Add PHP Attributes to serializer examples --- components/serializer.rst | 84 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/components/serializer.rst b/components/serializer.rst index c484a9ed170..5f32da7c468 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -315,6 +315,26 @@ Then, create your groups definition: // ... } + .. code-block:: php-attributes + + namespace Acme; + + use Symfony\Component\Serializer\Annotation\Groups; + + class MyObj + { + #[Groups(['group1', 'group2'])] + public $foo; + + #[Groups(['group3'])] + public function getBar() // is* methods are also supported + { + return $this->bar; + } + + // ... + } + .. code-block:: yaml Acme\MyObj: @@ -437,6 +457,20 @@ Option 1: Using ``@Ignore`` Annotation public $bar; } + .. code-block:: php-attributes + + namespace App\Model; + + use Symfony\Component\Serializer\Annotation\Ignore; + + class MyClass + { + public $foo; + + #[Ignore] + public $bar; + } + .. code-block:: yaml App\Model\MyClass: @@ -658,6 +692,25 @@ defines a ``Person`` entity with a ``firstName`` property: // ... } + .. code-block:: php-attributes + + namespace App\Entity; + + use Symfony\Component\Serializer\Annotation\SerializedName; + + class Person + { + #[SerializedName('customer_name')] + private $firstName; + + public function __construct($firstName) + { + $this->firstName = $firstName; + } + + // ... + } + .. code-block:: yaml App\Entity\Person: @@ -1214,6 +1267,20 @@ Here, we set it to 2 for the ``$child`` property: // ... } + .. code-block:: php-attributes + + namespace Acme; + + use Symfony\Component\Serializer\Annotation\MaxDepth; + + class MyObj + { + #[MaxDepth(2)] + public $child; + + // ... + } + .. code-block:: yaml Acme\MyObj: @@ -1524,6 +1591,23 @@ and ``BitBucketCodeRepository`` classes: // ... } + .. code-block:: php-attributes + + namespace App; + + use App\BitBucketCodeRepository; + use App\GitHubCodeRepository; + use Symfony\Component\Serializer\Annotation\DiscriminatorMap; + + #[DiscriminatorMap(typeProperty: 'type', mapping: [ + 'github' => GitHubCodeRepository::class, + 'bitbucket' => BitBucketCodeRepository::class, + ])] + interface CodeRepository + { + // ... + } + .. code-block:: yaml App\CodeRepository: From 8c0f61ce423e02bd0f0cec10fdbf5fc8474f049b Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sun, 14 Mar 2021 13:01:51 +0100 Subject: [PATCH 0022/5386] [Validator] Fixed a minor RST syntax issue --- reference/constraints/Compound.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/constraints/Compound.rst b/reference/constraints/Compound.rst index 53ce70c6df2..95d9ba10789 100644 --- a/reference/constraints/Compound.rst +++ b/reference/constraints/Compound.rst @@ -21,7 +21,7 @@ Basic Usage ----------- Suppose that you have different places where a user password must be validated, -you can create your own named set or requirements to be reused consistently everywhere:: +you can create your own named set or requirements to be reused consistently everywhere: .. configuration-block:: From 2f3d95778ff70da9288ae87b4ce38309681435b2 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Sun, 14 Mar 2021 19:11:11 +0100 Subject: [PATCH 0023/5386] [Session] Add missing semicolon --- session/locale_sticky_session.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/session/locale_sticky_session.rst b/session/locale_sticky_session.rst index f8caef23370..265298f864b 100644 --- a/session/locale_sticky_session.rst +++ b/session/locale_sticky_session.rst @@ -109,7 +109,8 @@ via some "Change Locale" route & controller), or create a route with the :ref:`_ $container->register(LocaleSubscriber::class) ->addArgument('%kernel.default_locale%') // uncomment the next line if you are not using autoconfigure - // ->addTag('kernel.event_subscriber'); + // ->addTag('kernel.event_subscriber') + ; That's it! Now celebrate by changing the user's locale and seeing that it's sticky throughout the request. From 74d2938580c363c38df6979700103483ec0b1d69 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Sun, 14 Mar 2021 19:38:47 +0100 Subject: [PATCH 0024/5386] [Intl] Fix typos --- components/intl.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/intl.rst b/components/intl.rst index 6417489b14e..dafe45800d0 100644 --- a/components/intl.rst +++ b/components/intl.rst @@ -110,7 +110,7 @@ to catching the exception, you can also check if a given language code is valid: $isValidLanguage = Languages::exists($languageCode); -Or if you have a alpha3 language code you want to check:: +Or if you have an alpha3 language code you want to check:: $isValidLanguage = Languages::alpha3CodeExists($alpha3Code); @@ -209,7 +209,7 @@ to catching the exception, you can also check if a given country code is valid:: $isValidCountry = Countries::exists($alpha2Code); -Or if you have a alpha3 country code you want to check:: +Or if you have an alpha3 country code you want to check:: $isValidCountry = Countries::alpha3CodeExists($alpha3Code); From ac44f85bd9596c5eff147f1b6ce93d8e7cf31817 Mon Sep 17 00:00:00 2001 From: Peter Date: Sun, 7 Mar 2021 21:03:35 +0100 Subject: [PATCH 0025/5386] Update description for Access decision strategies Updated the description to reflect the current behavior of the builtin AccessDecisionManager. --- security/voters.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/security/voters.rst b/security/voters.rst index 98ba54519af..869df508d50 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -278,12 +278,16 @@ There are three strategies available: This grants access as soon as there is *one* voter granting access; ``consensus`` - This grants access if there are more voters granting access than denying; + This grants access if there are more voters granting access than + denying. If case of a tie the decision is based on the + ``allow_if_equal_granted_denied`` config option (defaulting to ``true``); ``unanimous`` - This only grants access if there is no voter denying access. If all voters - abstained from voting, the decision is based on the ``allow_if_all_abstain`` - config option (which defaults to ``false``). + This only grants access if there is no voter denying access. + +Regardless the chosen strategy, if all voters abstained from voting, the +decision is based on the ``allow_if_all_abstain`` config option (which +defaults to ``false``). In the above scenario, both voters should grant access in order to grant access to the user to read the post. In this case, the default strategy is no longer From d24d45c3bfdc68e9b6040e939fc9d21ee7588be6 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 12 Mar 2021 17:16:49 +0100 Subject: [PATCH 0026/5386] [Translation] Move the "templates" section into the main guide --- _build/redirection_map | 1 + translation.rst | 121 +++++++++++++++++++++++++++++++++++-- translation/templates.rst | 123 -------------------------------------- 3 files changed, 116 insertions(+), 129 deletions(-) delete mode 100644 translation/templates.rst diff --git a/_build/redirection_map b/_build/redirection_map index 4954ce471fa..fe432c55aa1 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -458,6 +458,7 @@ /templating/embedding_controllers /templates#embedding-controllers /templating/inheritance /templates#template-inheritance-and-layouts /testing/doctrine /testing/database +/translation/templates /translation#translation-in-templates /doctrine/lifecycle_callbacks /doctrine/events /doctrine/event_listeners_subscribers /doctrine/events /doctrine/common_extensions /doctrine diff --git a/translation.rst b/translation.rst index 0e1601cc536..bb822614451 100644 --- a/translation.rst +++ b/translation.rst @@ -304,14 +304,124 @@ Translations in Templates ------------------------- Most of the time, translation occurs in templates. Symfony provides native -support for both Twig and PHP templates: +support for both Twig and PHP templates. -.. code-block:: html+twig +Using Twig Tags +~~~~~~~~~~~~~~~ -

{% trans %}Symfony is great!{% endtrans %}

+Symfony provides specialized Twig tags (``trans`` and ``transchoice``) to +help with message translation of *static blocks of text*: + +.. code-block:: twig + + {% trans %}Hello %name%{% endtrans %} + + {% transchoice count %} + {0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples + {% endtranschoice %} + +The ``transchoice`` tag automatically gets the ``%count%`` variable from +the current context and passes it to the translator. This mechanism only +works when you use a placeholder following the ``%var%`` pattern. + +.. deprecated:: 4.2 + + The ``transchoice`` tag is deprecated since Symfony 4.2 and will be + removed in 5.0. Use the :doc:`ICU MessageFormat ` with + the ``trans`` tag instead. + +.. caution:: + + The ``%var%`` notation of placeholders is required when translating in + Twig templates using the tag. + +.. tip:: + + If you need to use the percent character (``%``) in a string, escape it by + doubling it: ``{% trans %}Percent: %percent%%%{% endtrans %}`` + +You can also specify the message domain and pass some additional variables: + +.. code-block:: twig + + {% trans with {'%name%': 'Fabien'} from 'app' %}Hello %name%{% endtrans %} + + {% trans with {'%name%': 'Fabien'} from 'app' into 'fr' %}Hello %name%{% endtrans %} + + {% transchoice count with {'%name%': 'Fabien'} from 'app' %} + {0} %name%, there are no apples|{1} %name%, there is one apple|]1,Inf[ %name%, there are %count% apples + {% endtranschoice %} + +.. _translation-filters: + +Using Twig Filters +~~~~~~~~~~~~~~~~~~ + +The ``trans`` and ``transchoice`` filters can be used to translate *variable +texts* and complex expressions: + +.. code-block:: twig + + {{ message|trans }} + + {{ message|transchoice(5) }} + + {{ message|trans({'%name%': 'Fabien'}, 'app') }} + + {{ message|transchoice(5, {'%name%': 'Fabien'}, 'app') }} + +.. deprecated:: 4.2 + + The ``transchoice`` filter is deprecated since Symfony 4.2 and will be + removed in 5.0. Use the :doc:`ICU MessageFormat ` with + the ``trans`` filter instead. + +.. tip:: + + Using the translation tags or filters have the same effect, but with + one subtle difference: automatic output escaping is only applied to + translations using a filter. In other words, if you need to be sure + that your translated message is *not* output escaped, you must apply + the ``raw`` filter after the translation filter: + + .. code-block:: html+twig + + {# text translated between tags is never escaped #} + {% trans %} +

foo

+ {% endtrans %} + + {% set message = '

foo

' %} + + {# strings and variables translated via a filter are escaped by default #} + {{ message|trans|raw }} + {{ '

bar

'|trans|raw }} + +.. tip:: + + You can set the translation domain for an entire Twig template with a single tag: + + .. code-block:: twig + + {% trans_default_domain 'app' %} + + Note that this only influences the current template, not any "included" + template (in order to avoid side effects). + +PHP Templates +~~~~~~~~~~~~~ + +The translator service is accessible in PHP templates through the +``translator`` helper:: + + trans('Symfony is great') ?> + + transChoice( + '{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples', + 10, + ['%count%' => 10] + ) ?> -Read :doc:`/translation/templates` for more information about the Twig tags and -filters for translation. Forcing the Translator Locale ----------------------------- @@ -600,7 +710,6 @@ Learn more :maxdepth: 1 translation/message_format - translation/templates translation/locale translation/debug translation/lint diff --git a/translation/templates.rst b/translation/templates.rst deleted file mode 100644 index 903f1934d92..00000000000 --- a/translation/templates.rst +++ /dev/null @@ -1,123 +0,0 @@ -Using Translation in Templates -============================== - -Twig Templates --------------- - -.. _translation-tags: - -Using Twig Tags -~~~~~~~~~~~~~~~ - -Symfony provides specialized Twig tags (``trans`` and ``transchoice``) to -help with message translation of *static blocks of text*: - -.. code-block:: twig - - {% trans %}Hello %name%{% endtrans %} - - {% transchoice count %} - {0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples - {% endtranschoice %} - -The ``transchoice`` tag automatically gets the ``%count%`` variable from -the current context and passes it to the translator. This mechanism only -works when you use a placeholder following the ``%var%`` pattern. - -.. deprecated:: 4.2 - - The ``transchoice`` tag is deprecated since Symfony 4.2 and will be - removed in 5.0. Use the :doc:`ICU MessageFormat ` with - the ``trans`` tag instead. - -.. caution:: - - The ``%var%`` notation of placeholders is required when translating in - Twig templates using the tag. - -.. tip:: - - If you need to use the percent character (``%``) in a string, escape it by - doubling it: ``{% trans %}Percent: %percent%%%{% endtrans %}`` - -You can also specify the message domain and pass some additional variables: - -.. code-block:: twig - - {% trans with {'%name%': 'Fabien'} from 'app' %}Hello %name%{% endtrans %} - - {% trans with {'%name%': 'Fabien'} from 'app' into 'fr' %}Hello %name%{% endtrans %} - - {% transchoice count with {'%name%': 'Fabien'} from 'app' %} - {0} %name%, there are no apples|{1} %name%, there is one apple|]1,Inf[ %name%, there are %count% apples - {% endtranschoice %} - -.. _translation-filters: - -Using Twig Filters -~~~~~~~~~~~~~~~~~~ - -The ``trans`` and ``transchoice`` filters can be used to translate *variable -texts* and complex expressions: - -.. code-block:: twig - - {{ message|trans }} - - {{ message|transchoice(5) }} - - {{ message|trans({'%name%': 'Fabien'}, 'app') }} - - {{ message|transchoice(5, {'%name%': 'Fabien'}, 'app') }} - -.. deprecated:: 4.2 - - The ``transchoice`` filter is deprecated since Symfony 4.2 and will be - removed in 5.0. Use the :doc:`ICU MessageFormat ` with - the ``trans`` filter instead. - -.. tip:: - - Using the translation tags or filters have the same effect, but with - one subtle difference: automatic output escaping is only applied to - translations using a filter. In other words, if you need to be sure - that your translated message is *not* output escaped, you must apply - the ``raw`` filter after the translation filter: - - .. code-block:: html+twig - - {# text translated between tags is never escaped #} - {% trans %} -

foo

- {% endtrans %} - - {% set message = '

foo

' %} - - {# strings and variables translated via a filter are escaped by default #} - {{ message|trans|raw }} - {{ '

bar

'|trans|raw }} - -.. tip:: - - You can set the translation domain for an entire Twig template with a single tag: - - .. code-block:: twig - - {% trans_default_domain 'app' %} - - Note that this only influences the current template, not any "included" - template (in order to avoid side effects). - -PHP Templates -------------- - -The translator service is accessible in PHP templates through the -``translator`` helper:: - - trans('Symfony is great') ?> - - transChoice( - '{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples', - 10, - ['%count%' => 10] - ) ?> From 271f8f6d64d9bb25893e88ae150c2507a6d3d64a Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 15 Mar 2021 20:13:00 +0100 Subject: [PATCH 0027/5386] Readded a missing reference --- translation.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/translation.rst b/translation.rst index bb822614451..ac14dd8c318 100644 --- a/translation.rst +++ b/translation.rst @@ -306,6 +306,8 @@ Translations in Templates Most of the time, translation occurs in templates. Symfony provides native support for both Twig and PHP templates. +.. _translation-tags: + Using Twig Tags ~~~~~~~~~~~~~~~ From 518926f33835067cc67a57c887e3490fe86d6961 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Tue, 16 Mar 2021 08:53:19 +0100 Subject: [PATCH 0028/5386] add a warning about Amazon SES signature --- mailer.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mailer.rst b/mailer.rst index ff567eab3bc..0a44eace54c 100644 --- a/mailer.rst +++ b/mailer.rst @@ -160,6 +160,11 @@ party provider: For example, the DSN ``ses+smtp://ABC1234:abc+12/345@default`` should be configured as ``ses+smtp://ABC1234:abc%2B12%2F345@default`` +.. caution:: + + Symfony 4.4 only suppports Amazon SES Signature Version 3, that has been deprecated. + You need to use symfony/amazon-mailer 5.1 or newer. + .. tip:: If you want to override the default host for a provider (to debug an issue using From 5cabc722845f9f08d4636d378636f56e07a70c03 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 16 Mar 2021 09:25:52 +0100 Subject: [PATCH 0029/5386] Typo --- mailer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailer.rst b/mailer.rst index 0a44eace54c..e236b27c1a5 100644 --- a/mailer.rst +++ b/mailer.rst @@ -162,7 +162,7 @@ party provider: .. caution:: - Symfony 4.4 only suppports Amazon SES Signature Version 3, that has been deprecated. + Symfony 4.4 only supports Amazon SES Signature Version 3, that has been deprecated. You need to use symfony/amazon-mailer 5.1 or newer. .. tip:: From dd280ea98bcb48529038852d7b3b653d8c72be3c Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 16 Mar 2021 09:27:04 +0100 Subject: [PATCH 0030/5386] minor --- mailer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailer.rst b/mailer.rst index e236b27c1a5..dd0c14956c3 100644 --- a/mailer.rst +++ b/mailer.rst @@ -162,8 +162,8 @@ party provider: .. caution:: - Symfony 4.4 only supports Amazon SES Signature Version 3, that has been deprecated. - You need to use symfony/amazon-mailer 5.1 or newer. + Symfony 4.4 only supports Amazon SES signature version 3 which has been + deprecated. You need to use ``symfony/amazon-mailer`` 5.1 or newer. .. tip:: From c9cff9fa76541ca82a240048f3aae48e4c2d25fa Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 16 Mar 2021 09:27:56 +0100 Subject: [PATCH 0031/5386] Remove caution. refs #15106 --- mailer.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mailer.rst b/mailer.rst index bbb7ab9305c..8f98d9b766f 100644 --- a/mailer.rst +++ b/mailer.rst @@ -174,11 +174,6 @@ party provider: For example, the DSN ``ses+smtp://ABC1234:abc+12/345@default`` should be configured as ``ses+smtp://ABC1234:abc%2B12%2F345@default`` -.. caution:: - - Symfony 4.4 only supports Amazon SES signature version 3 which has been - deprecated. You need to use ``symfony/amazon-mailer`` 5.1 or newer. - .. note:: When using SMTP, the default timeout for sending a message before throwing an From e37983a7cc8316fc409a0c9b6a5fc85b95309d22 Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Tue, 16 Mar 2021 16:34:14 +0100 Subject: [PATCH 0032/5386] Update logging.rst --- logging.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logging.rst b/logging.rst index d4ed95189ba..ae9ddd10a73 100644 --- a/logging.rst +++ b/logging.rst @@ -23,7 +23,7 @@ To do so, :ref:`override the "logger" service definition `. Logging a Message ----------------- -To log a message, inject the default logger in your controller:: +To log a message, inject the default logger in your controller or service:: use Psr\Log\LoggerInterface; From 61dc76568fe769311e98b76df8682b190df34e41 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Wed, 17 Mar 2021 10:18:54 +0100 Subject: [PATCH 0033/5386] Use UserBadge in all passports --- security/experimental_authenticators.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/experimental_authenticators.rst b/security/experimental_authenticators.rst index eb0ffa098e0..269aefe01a0 100644 --- a/security/experimental_authenticators.rst +++ b/security/experimental_authenticators.rst @@ -494,7 +494,7 @@ The following credential classes are supported by default: use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials; // ... - return new Passport($user, new PasswordCredentials($plaintextPassword)); + return new Passport(new UserBadge($email), new PasswordCredentials($plaintextPassword)); :class:`Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Credentials\\CustomCredentials` Allows a custom closure to check credentials:: @@ -502,7 +502,7 @@ The following credential classes are supported by default: use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\CustomCredentials; // ... - return new Passport($user, new CustomCredentials( + return new Passport(new UserBadge($email), new CustomCredentials( // If this function returns anything else than `true`, the credentials // are marked as invalid. // The $credentials parameter is equal to the next argument of this class @@ -581,7 +581,7 @@ would initialize the passport like this:: // ... validate no parameter is empty return new Passport( - new UserBadge($user), + new UserBadge($email), new PasswordCredentials($password), [new CsrfTokenBadge('login', $csrfToken)] ); From 316da38f2444913392161afa202e95e5be3edca3 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 17 Mar 2021 11:33:49 +0100 Subject: [PATCH 0034/5386] Fix DSN --- mailer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailer.rst b/mailer.rst index 8f98d9b766f..15c3d48ddcf 100644 --- a/mailer.rst +++ b/mailer.rst @@ -165,7 +165,7 @@ party provider: Mailjet mailjet+smtp://ACCESS_KEY:SECRET_KEY@default n/a mailjet+api://ACCESS_KEY:SECRET_KEY@default Postmark postmark+smtp://ID:ID@default n/a postmark+api://KEY@default Sendgrid sendgrid+smtp://apikey:KEY@default n/a sendgrid+api://KEY@default - Sendinblue sendinblue+smtp://apikey:USERNAME:PASSWORD@default n/a sendinblue+api://KEY@default + Sendinblue sendinblue+smtp://USERNAME:PASSWORD@default n/a sendinblue+api://KEY@default ==================== ==================================================== =========================================== ======================================== .. caution:: From 89a9964dea89a754283a00d966ede0636c6fcf34 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 17 Mar 2021 11:35:22 +0100 Subject: [PATCH 0035/5386] Fix DSNs --- mailer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailer.rst b/mailer.rst index dd0c14956c3..dda2efc5898 100644 --- a/mailer.rst +++ b/mailer.rst @@ -150,8 +150,8 @@ party provider: Google Gmail gmail+smtp://USERNAME:PASSWORD@default n/a n/a Mailchimp Mandrill mandrill+smtp://USERNAME:PASSWORD@default mandrill+https://KEY@default mandrill+api://KEY@default Mailgun mailgun+smtp://USERNAME:PASSWORD@default mailgun+https://KEY:DOMAIN@default mailgun+api://KEY:DOMAIN@default - Postmark postmark+smtp://ID:ID@default n/a postmark+api://KEY@default - Sendgrid sendgrid+smtp://apikey:KEY@default n/a sendgrid+api://KEY@default + Postmark postmark+smtp://ID@default n/a postmark+api://KEY@default + Sendgrid sendgrid+smtp://KEY@default n/a sendgrid+api://KEY@default ==================== ========================================== =========================================== ======================================== .. caution:: From f019d537fa82e5f93929f3c1b4c9f2a469219141 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 17 Mar 2021 11:37:17 +0100 Subject: [PATCH 0036/5386] Use correct domain --- mailer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailer.rst b/mailer.rst index dd0c14956c3..0f57ba46164 100644 --- a/mailer.rst +++ b/mailer.rst @@ -173,8 +173,8 @@ party provider: .. code-block:: env # .env - MAILER_DSN=mailgun+https://KEY:DOMAIN@example.com - MAILER_DSN=mailgun+https://KEY:DOMAIN@example.com:99 + MAILER_DSN=mailgun+https://KEY:DOMAIN@requestbin.com + MAILER_DSN=mailgun+https://KEY:DOMAIN@requestbin.com:99 Note that the protocol is *always* HTTPs and cannot be changed. From b66dd5f27581c0cf7df1e66966b28c502f29eb51 Mon Sep 17 00:00:00 2001 From: cedric lombardot Date: Wed, 17 Mar 2021 16:51:14 +0100 Subject: [PATCH 0037/5386] Fix to use yaml syntax --- deployment/proxies.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/proxies.rst b/deployment/proxies.rst index 5f24a69a418..a51aa1c8889 100644 --- a/deployment/proxies.rst +++ b/deployment/proxies.rst @@ -31,11 +31,11 @@ and what headers your reverse proxy uses to send information: # config/packages/framework.yaml framework: # ... - // the IP address (or range) of your proxy + # the IP address (or range) of your proxy trusted_proxies: '192.0.0.1,10.0.0.0/8' - // trust *all* "X-Forwarded-*" headers + # trust *all* "X-Forwarded-*" headers trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port'] - // or, if your proxy instead uses the "Forwarded" header + # or, if your proxy instead uses the "Forwarded" header trusted_headers: ['forwarded'] .. code-block:: xml From 97614c0f05bc84e035c0a21ed0c019d27e2e5024 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 17 Mar 2021 17:30:31 +0100 Subject: [PATCH 0038/5386] Remove Jakub from the core team --- contributing/code/core_team.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contributing/code/core_team.rst b/contributing/code/core_team.rst index 4c719ff4330..136edb28dbb 100644 --- a/contributing/code/core_team.rst +++ b/contributing/code/core_team.rst @@ -60,7 +60,6 @@ Active Core Members * **Christian Flothmann** (`xabbuh`_); * **Tobias Schultze** (`Tobion`_); * **Kévin Dunglas** (`dunglas`_); - * **Jakub Zalas** (`jakzal`_); * **Javier Eguiluz** (`javiereguiluz`_); * **Grégoire Pineau** (`lyrixx`_); * **Ryan Weaver** (`weaverryan`_); @@ -106,7 +105,8 @@ Symfony contributions: * **Romain Neutron** (`romainneutron`_); * **Jordi Boggiano** (`Seldaek`_); * **Lukas Kahwe Smith** (`lsmith77`_); -* **Jules Pietri** (`HeahDude`_). +* **Jules Pietri** (`HeahDude`_); +* **Jakub Zalas** (`jakzal`_). Core Membership Application ~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 3a10fff91326c84f1c3956d19a60d89f513501ab Mon Sep 17 00:00:00 2001 From: Nicolas Hart Date: Wed, 17 Mar 2021 22:23:20 +0100 Subject: [PATCH 0039/5386] [Testing] Fix typo in assertEmailAttachmentCount --- testing/functional_tests_assertions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/functional_tests_assertions.rst b/testing/functional_tests_assertions.rst index edf1a6bb679..29e4b1e5e3a 100644 --- a/testing/functional_tests_assertions.rst +++ b/testing/functional_tests_assertions.rst @@ -84,7 +84,7 @@ Mailer - ``assertQueuedEmailCount()`` - ``assertEmailIsQueued()`` - ``assertEmailIsNotQueued()`` -- ``assertEmailAttachementCount()`` +- ``assertEmailAttachmentCount()`` - ``assertEmailTextBodyContains()`` - ``assertEmailTextBodyNotContains()`` - ``assertEmailHtmlBodyContains()`` From 07dea78ee4fe513abd4d6abf0622d1a8315a7aab Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Fri, 19 Mar 2021 09:04:52 +0100 Subject: [PATCH 0040/5386] Update workflow.rst --- workflow.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow.rst b/workflow.rst index 7f7acffaa3a..fa489c63cf7 100644 --- a/workflow.rst +++ b/workflow.rst @@ -238,7 +238,8 @@ Accessing the Workflow in a Class You can use the workflow inside a class by using :doc:`service autowiring ` and using -``camelCased workflow name + Workflow`` as parameter name:: +``camelCased workflow name + Workflow`` as parameter name. If it is a state machine type +you can use ``camelCased workflow name + StateMachine``:: use App\Entity\BlogPost; use Symfony\Component\Workflow\WorkflowInterface; From 455edf4f2a7a764ae16ab06b5878600f38149dfd Mon Sep 17 00:00:00 2001 From: Hossein Vakili Date: Thu, 18 Mar 2021 13:01:45 +0100 Subject: [PATCH 0041/5386] Add Oracle DATABASE_URL instruction --- doctrine.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doctrine.rst b/doctrine.rst index e1ee1785c00..9d98f26b7ca 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -54,6 +54,9 @@ The database connection information is stored as an environment variable called # to use postgresql: # DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8" + + # to use oracle: + # DATABASE_URL="oci8://db_user:db_password@127.0.0.1:1521/db_name" .. caution:: From b3f014dff10f9331102fa1cb6fe56c000fff32b9 Mon Sep 17 00:00:00 2001 From: rodmar35 Date: Thu, 18 Mar 2021 09:56:35 +0100 Subject: [PATCH 0042/5386] Update reverse_engineering.rst --- doctrine/reverse_engineering.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doctrine/reverse_engineering.rst b/doctrine/reverse_engineering.rst index 087e41db955..320e424ea0a 100644 --- a/doctrine/reverse_engineering.rst +++ b/doctrine/reverse_engineering.rst @@ -99,9 +99,12 @@ run: .. code-block:: terminal - // generates getter/setter methods + // generates getter/setter methods for all Entities $ php bin/console make:entity --regenerate App + // generates getter/setter methods for one specific Entity + $ php bin/console make:entity --regenerate App\\Entity\\Country + .. note:: If you want to have a OneToMany relationship, you will need to add From 019a8c82fa800777a7ea85dafe26cfccfdd9d9a7 Mon Sep 17 00:00:00 2001 From: cedric lombardot Date: Sat, 20 Mar 2021 11:42:29 +0100 Subject: [PATCH 0043/5386] Fix yaml syntax --- deployment/proxies.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/proxies.rst b/deployment/proxies.rst index a51aa1c8889..49aa04c8361 100644 --- a/deployment/proxies.rst +++ b/deployment/proxies.rst @@ -125,8 +125,8 @@ In this case, you'll need to - *very carefully* - trust *all* proxies. # config/packages/framework.yaml framework: # ... - // trust *all* requests (the 'REMOTE_ADDR' string is replaced at - // run time by $_SERVER['REMOTE_ADDR']) + # trust *all* requests (the 'REMOTE_ADDR' string is replaced at + # run time by $_SERVER['REMOTE_ADDR']) trusted_proxies: '127.0.0.1,REMOTE_ADDR' That's it! It's critical that you prevent traffic from all non-trusted sources. From 6e3a415ad1d256e630aa34c5a2507f9f46f793b2 Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Sat, 20 Mar 2021 19:07:46 +0100 Subject: [PATCH 0044/5386] Update bc.rst --- contributing/code/bc.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/contributing/code/bc.rst b/contributing/code/bc.rst index 15f1f03674d..371c1a35b95 100644 --- a/contributing/code/bc.rst +++ b/contributing/code/bc.rst @@ -4,10 +4,13 @@ Our Backward Compatibility Promise Ensuring smooth upgrades of your projects is our first priority. That's why we promise you backward compatibility (BC) for all minor Symfony releases. You probably recognize this strategy as `Semantic Versioning`_. In short, -Semantic Versioning means that only major releases (such as 2.0, 3.0 etc.) are -allowed to break backward compatibility. Minor releases (such as 2.5, 2.6 etc.) +Semantic Versioning means that only major releases (such as 5.0, 6.0 etc.) are +allowed to break backward compatibility. Minor releases (such as 5.1, 5.2 etc.) may introduce new features, but must do so without breaking the existing API of -that release branch (2.x in the previous example). +that release branch (5.x in the previous example). + +We also provide deprecation message triggered in the code base to help you with +the migration process across major release. .. caution:: From 0e04632a01caee166f8dff10d5de2101e851627b Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Sat, 20 Mar 2021 16:51:09 -0400 Subject: [PATCH 0045/5386] Remove extra slash in template path --- configuration/override_dir_structure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/override_dir_structure.rst b/configuration/override_dir_structure.rst index e0bd417886d..ece722f6f27 100644 --- a/configuration/override_dir_structure.rst +++ b/configuration/override_dir_structure.rst @@ -109,7 +109,7 @@ for multiple directories): # config/packages/twig.yaml twig: # ... - default_path: "%kernel.project_dir%//resources/views" + default_path: "%kernel.project_dir%/resources/views" .. code-block:: xml From 7bbfe94d3a8a6e1d7743491fd7dd3fa97b04b979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4dlich?= <1880467+jschaedl@users.noreply.github.com> Date: Sun, 21 Mar 2021 14:09:17 +0100 Subject: [PATCH 0046/5386] Remove SentMessage paragraph The Notifier's `send` method does not return a `SentMessage` object: https://github.com/symfony/symfony/blob/5.2/src/Symfony/Component/Notifier/NotifierInterface.php#L26 Only the Chatter and Texter classes `send` methods returns a `SendMessage`. --- notifier.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/notifier.rst b/notifier.rst index d328084c0b8..0c8309aec71 100644 --- a/notifier.rst +++ b/notifier.rst @@ -380,7 +380,7 @@ To send a notification, autowire the ); // Send the notification to the recipient - $sentMessage = $notifier->send($notification, $recipient); + $notifier->send($notification, $recipient); // ... } @@ -391,14 +391,6 @@ channels. The channels specify which channel (or transport) should be used to send the notification. For instance, ``['email', 'sms']`` will send both an email and sms notification to the user. -The ``send()`` method used to send the notification returns a variable of type -:class:`Symfony\\Component\\Notifier\\Message\\SentMessage` which provides -information such as the message ID and the original message contents. - -.. versionadded:: 5.2 - - The ``SentMessage`` class was introduced in Symfony 5.2. - The default notification also has a ``content()`` and ``emoji()`` method to set the notification content and icon. From 7803935f38f770401db5a477d8accdac20f83809 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:57:06 +0100 Subject: [PATCH 0047/5386] [Intl] Remove duplicated parentheses --- components/intl.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/intl.rst b/components/intl.rst index dafe45800d0..dae70440cf5 100644 --- a/components/intl.rst +++ b/components/intl.rst @@ -381,8 +381,8 @@ arguments to get the offset at any given point in time:: The string representation of the GMT offset can vary depending on the locale, so you can pass the locale as the third optional argument:: - $offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'ar')); // $offset = 'غرينتش+01:00' - $offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'dz')); // $offset = 'ཇི་ཨེམ་ཏི་+01:00' + $offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'ar'); // $offset = 'غرينتش+01:00' + $offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'dz'); // $offset = 'ཇི་ཨེམ་ཏི་+01:00' If the given timezone ID doesn't exist, the methods trigger a :class:`Symfony\\Component\\Intl\\Exception\\MissingResourceException`. In addition From e28f5a1172ed0f520b9d218b81a956b6f6a2a790 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Sun, 21 Mar 2021 23:01:14 +0100 Subject: [PATCH 0048/5386] [Filesystem] Fix typo --- components/filesystem.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/filesystem.rst b/components/filesystem.rst index c0cad3dc9b9..4b09bc4cd7e 100644 --- a/components/filesystem.rst +++ b/components/filesystem.rst @@ -162,7 +162,7 @@ permissions of a file. The fourth argument is a boolean recursive option:: // sets the mode of the video to 0600 $filesystem->chmod('video.ogg', 0600); - // changes the mod of the src directory recursively + // changes the mode of the src directory recursively $filesystem->chmod('src', 0700, 0000, true); .. note:: From bc8997112a103b12493c4869c5f6592c85ca8367 Mon Sep 17 00:00:00 2001 From: Farhad Safarov Date: Tue, 23 Mar 2021 10:07:30 +0300 Subject: [PATCH 0049/5386] [Mailer] fix ses+smtp credentials format --- mailer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailer.rst b/mailer.rst index e7ca76dbb7f..42ec190574a 100644 --- a/mailer.rst +++ b/mailer.rst @@ -146,7 +146,7 @@ party provider: ==================== ========================================== =========================================== ======================================== Provider SMTP HTTP API ==================== ========================================== =========================================== ======================================== - Amazon SES ses+smtp://ACCESS_KEY:SECRET_KEY@default ses+https://ACCESS_KEY:SECRET_KEY@default ses+api://ACCESS_KEY:SECRET_KEY@default + Amazon SES ses+smtp://USERNAME:PASSWORD@default ses+https://ACCESS_KEY:SECRET_KEY@default ses+api://ACCESS_KEY:SECRET_KEY@default Google Gmail gmail+smtp://USERNAME:PASSWORD@default n/a n/a Mailchimp Mandrill mandrill+smtp://USERNAME:PASSWORD@default mandrill+https://KEY@default mandrill+api://KEY@default Mailgun mailgun+smtp://USERNAME:PASSWORD@default mailgun+https://KEY:DOMAIN@default mailgun+api://KEY:DOMAIN@default From e1ca15247611f9dfa2b88c4f00ab2a2cb41c8b80 Mon Sep 17 00:00:00 2001 From: Al-Saleh KEITA <28827545+askeita@users.noreply.github.com> Date: Mon, 22 Mar 2021 13:57:04 +0100 Subject: [PATCH 0050/5386] Typo with backticks. Removed extra backticks. --- http_cache/validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http_cache/validation.rst b/http_cache/validation.rst index 3a1dabf902e..599d0883b52 100644 --- a/http_cache/validation.rst +++ b/http_cache/validation.rst @@ -106,7 +106,7 @@ doing so much work. .. tip:: - Symfony also supports weak ``ETag``s by passing ``true`` as the second + Symfony also supports weak ``ETag`` s by passing ``true`` as the second argument to the :method:`Symfony\\Component\\HttpFoundation\\Response::setEtag` method. From 40bdc02b644f722430b6178ab1c0315cf4edf9fb Mon Sep 17 00:00:00 2001 From: Ilya Antipenko Date: Tue, 23 Mar 2021 18:19:11 +0100 Subject: [PATCH 0051/5386] Fix markdown in multiple_entity_managers.rst --- doctrine/multiple_entity_managers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doctrine/multiple_entity_managers.rst b/doctrine/multiple_entity_managers.rst index ba3475dbfbc..57b2879f868 100644 --- a/doctrine/multiple_entity_managers.rst +++ b/doctrine/multiple_entity_managers.rst @@ -313,6 +313,6 @@ The same applies to repository calls:: // ... } - You should now always fetch this repository using ``ManagerRegistry::getRepository()``. +You should now always fetch this repository using ``ManagerRegistry::getRepository()``. .. _`several alternatives`: https://stackoverflow.com/a/11494543 From 85c9813c7adb18bba646492b792e54bb9fc94427 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 24 Mar 2021 11:34:54 +0100 Subject: [PATCH 0052/5386] Minor tweak --- doctrine/multiple_entity_managers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doctrine/multiple_entity_managers.rst b/doctrine/multiple_entity_managers.rst index 57b2879f868..32e5a979cdb 100644 --- a/doctrine/multiple_entity_managers.rst +++ b/doctrine/multiple_entity_managers.rst @@ -313,6 +313,6 @@ The same applies to repository calls:: // ... } -You should now always fetch this repository using ``ManagerRegistry::getRepository()``. + You should now always fetch this repository using ``ManagerRegistry::getRepository()``. .. _`several alternatives`: https://stackoverflow.com/a/11494543 From 3938dbdc9b63f80d9900396f903e1f8d8b446fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Mon, 22 Mar 2021 10:22:09 +0100 Subject: [PATCH 0053/5386] Fixed invalid alias definition in "Deprecating Service Aliases" YAML example Fixed invalid alias definition in "Deprecating Service Aliases" YAML example. Current version is ```yaml app.mailer: alias: '@App\Mail\PhpMailer' # .... ``` Correct version is ```yaml app.mailer: alias: 'App\Mail\PhpMailer' # .... ``` (without `@` prefix in service id) --- service_container/alias_private.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_container/alias_private.rst b/service_container/alias_private.rst index bac0b8fdc5f..f202ce8d277 100644 --- a/service_container/alias_private.rst +++ b/service_container/alias_private.rst @@ -166,7 +166,7 @@ or you decided not to maintain it anymore), you can deprecate its definition: .. code-block:: yaml app.mailer: - alias: '@App\Mail\PhpMailer' + alias: 'App\Mail\PhpMailer' # this will display a generic deprecation message... deprecated: true From 53fab68e61f0eccc1a0d51b74d4ee97ddbbf6cfb Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 24 Mar 2021 12:27:28 +0100 Subject: [PATCH 0054/5386] Tweak --- workflow.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow.rst b/workflow.rst index fa489c63cf7..74d986ed868 100644 --- a/workflow.rst +++ b/workflow.rst @@ -238,8 +238,8 @@ Accessing the Workflow in a Class You can use the workflow inside a class by using :doc:`service autowiring ` and using -``camelCased workflow name + Workflow`` as parameter name. If it is a state machine type -you can use ``camelCased workflow name + StateMachine``:: +``camelCased workflow name + Workflow`` as parameter name. If it is a state +machine type, use ``camelCased workflow name + StateMachine``:: use App\Entity\BlogPost; use Symfony\Component\Workflow\WorkflowInterface; From 485637c22d154f26a2ad3d3f5605e5e244c9ec64 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 24 Mar 2021 12:31:06 +0100 Subject: [PATCH 0055/5386] Minor tweak --- mailer.rst | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/mailer.rst b/mailer.rst index cda5c1fb646..b632449c4b5 100644 --- a/mailer.rst +++ b/mailer.rst @@ -155,11 +155,10 @@ transport, but you can force to use one: This table shows the full list of available DSN formats for each third party provider: -<<<<<<< HEAD ==================== ==================================================== =========================================== ======================================== Provider SMTP HTTP API ==================== ==================================================== =========================================== ======================================== - Amazon SES ses+smtp://ACCESS_KEY:SECRET_KEY@default ses+https://ACCESS_KEY:SECRET_KEY@default ses+api://ACCESS_KEY:SECRET_KEY@default + Amazon SES ses+smtp://USERNAME:PASSWORD@default ses+https://ACCESS_KEY:SECRET_KEY@default ses+api://ACCESS_KEY:SECRET_KEY@default Google Gmail gmail+smtp://USERNAME:PASSWORD@default n/a n/a Mailchimp Mandrill mandrill+smtp://USERNAME:PASSWORD@default mandrill+https://KEY@default mandrill+api://KEY@default Mailgun mailgun+smtp://USERNAME:PASSWORD@default mailgun+https://KEY:DOMAIN@default mailgun+api://KEY:DOMAIN@default @@ -168,18 +167,7 @@ party provider: Sendgrid sendgrid+smtp://KEY@default n/a sendgrid+api://KEY@default Sendinblue sendinblue+smtp://USERNAME:PASSWORD@default n/a sendinblue+api://KEY@default ==================== ==================================================== =========================================== ======================================== -======= -==================== ========================================== =========================================== ======================================== - Provider SMTP HTTP API -==================== ========================================== =========================================== ======================================== - Amazon SES ses+smtp://USERNAME:PASSWORD@default ses+https://ACCESS_KEY:SECRET_KEY@default ses+api://ACCESS_KEY:SECRET_KEY@default - Google Gmail gmail+smtp://USERNAME:PASSWORD@default n/a n/a - Mailchimp Mandrill mandrill+smtp://USERNAME:PASSWORD@default mandrill+https://KEY@default mandrill+api://KEY@default - Mailgun mailgun+smtp://USERNAME:PASSWORD@default mailgun+https://KEY:DOMAIN@default mailgun+api://KEY:DOMAIN@default - Postmark postmark+smtp://ID@default n/a postmark+api://KEY@default - Sendgrid sendgrid+smtp://KEY@default n/a sendgrid+api://KEY@default -==================== ========================================== =========================================== ======================================== ->>>>>>> 4.4 + .. caution:: From 8aaf4776218a914da649cff13f4ffc712e445236 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 24 Mar 2021 12:31:15 +0100 Subject: [PATCH 0056/5386] Revert minor tweak --- mailer.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/mailer.rst b/mailer.rst index b632449c4b5..721e2144654 100644 --- a/mailer.rst +++ b/mailer.rst @@ -168,7 +168,6 @@ party provider: Sendinblue sendinblue+smtp://USERNAME:PASSWORD@default n/a sendinblue+api://KEY@default ==================== ==================================================== =========================================== ======================================== - .. caution:: If your credentials contain special characters, you must URL-encode them. From f749e254733b9ccfbe342646fad1d38b5e196ada Mon Sep 17 00:00:00 2001 From: KalleV Date: Thu, 25 Mar 2021 11:59:45 -0400 Subject: [PATCH 0057/5386] docs(http-client): fix default retry_failed configuration example The framework bundle configuration validation requires the top-level http client retry_failed configuration to be nested under default_options or scoped_clients. See: https://github.com/symfony/framework-bundle/blob/1f977bb1b790f915b22462e511b039fb761280b3/DependencyInjection/Configuration.php#L1414 --- reference/configuration/framework.rst | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 6458d77328a..5ea8a8cee0a 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -831,17 +831,18 @@ will automatically retry failed HTTP requests. # ... http_client: # ... - retry_failed: - # retry_strategy: app.custom_strategy - http_codes: - 0: ['GET', 'HEAD'] # retry network errors if request method is GET or HEAD - 429: true # retry all responses with 429 status code - 500: ['GET', 'HEAD'] - max_retries: 2 - delay: 1000 - multiplier: 3 - max_delay: 5000 - jitter: 0.3 + default_options: + retry_failed: + # retry_strategy: app.custom_strategy + http_codes: + 0: ['GET', 'HEAD'] # retry network errors if request method is GET or HEAD + 429: true # retry all responses with 429 status code + 500: ['GET', 'HEAD'] + max_retries: 2 + delay: 1000 + multiplier: 3 + max_delay: 5000 + jitter: 0.3 scoped_clients: my_api.client: From 1cc3689e8a8e896e4959807302b8f6f28911c61a Mon Sep 17 00:00:00 2001 From: Ivan Gantsev Date: Fri, 26 Mar 2021 10:57:52 +0300 Subject: [PATCH 0058/5386] Update rate_limiter.rst Inject HttpFoundation $request in action of controller --- rate_limiter.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rate_limiter.rst b/rate_limiter.rst index 6982f88cae4..22e78fa6c39 100644 --- a/rate_limiter.rst +++ b/rate_limiter.rst @@ -167,6 +167,7 @@ the number of requests to the API:: namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; + use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException; use Symfony\Component\RateLimiter\RateLimiterFactory; @@ -174,7 +175,7 @@ the number of requests to the API:: { // if you're using service autowiring, the variable name must be: // "rate limiter name" (in camelCase) + "Limiter" suffix - public function index(RateLimiterFactory $anonymousApiLimiter) + public function index(Request $request, RateLimiterFactory $anonymousApiLimiter) { // create a limiter based on a unique identifier of the client // (e.g. the client's IP address, a username/email, an API key, etc.) @@ -272,12 +273,13 @@ the :class:`Symfony\\Component\\RateLimiter\\Reservation` object returned by the namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; + use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\RateLimiter\RateLimiterFactory; class ApiController extends AbstractController { - public function index(RateLimiterFactory $anonymousApiLimiter) + public function index(Request $request, RateLimiterFactory $anonymousApiLimiter) { $limiter = $anonymousApiLimiter->create($request->getClientIp()); $limit = $limiter->consume(); From c4dd584759b514f9158c115e8da988285d910406 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 26 Mar 2021 09:10:21 +0100 Subject: [PATCH 0059/5386] [#15074] fix typo --- security/voters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/voters.rst b/security/voters.rst index 869df508d50..c8daae7ba38 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -279,7 +279,7 @@ There are three strategies available: ``consensus`` This grants access if there are more voters granting access than - denying. If case of a tie the decision is based on the + denying. In case of a tie the decision is based on the ``allow_if_equal_granted_denied`` config option (defaulting to ``true``); ``unanimous`` From cf8f937743d5f9afaaae7911796d90e68adb3e66 Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Sun, 5 Apr 2020 04:19:52 +0200 Subject: [PATCH 0060/5386] [Validator] Added grouped constraints in `Collection` reference --- reference/constraints/Collection.rst | 34 ++++++++++++++++++++++++++++ validation/raw_values.rst | 7 ++++++ 2 files changed, 41 insertions(+) diff --git a/reference/constraints/Collection.rst b/reference/constraints/Collection.rst index 2f3dfd52035..c60679aa90b 100644 --- a/reference/constraints/Collection.rst +++ b/reference/constraints/Collection.rst @@ -289,6 +289,40 @@ However, if the ``personal_email`` field does not exist in the array, the ``NotBlank`` constraint will still be applied (since it is wrapped in ``Required``) and you will receive a constraint violation. +When you define groups in nested constraints they are automatically added to +the ``Collection`` constraint itself so it can be traversed for all nested +groups. Take the following example:: + + use Symfony\Component\Validator\Constraints as Assert; + + $constraint = new Assert\Collection([ + 'fields' => [ + 'name' => new Assert\NotBlank(['groups' => 'basic']), + 'email' => new Assert\NotBlank(['groups' => 'contact']), + ], + ]); + +This will result in the following configuration:: + + $constraint = new Assert\Collection([ + 'fields' => [ + 'name' => new Assert\Required([ + 'constraints' => new Assert\NotBlank(['groups' => 'basic']), + 'groups' => ['basic', 'strict'], + ]), + 'email' => new Assert\Required([ + "constraints" => new Assert\NotBlank(['groups' => 'contact']), + 'groups' => ['basic', 'strict'], + ]), + ], + 'groups' => ['basic', 'strict'], + ]); + +The default ``allowMissingFields`` option requires the fields in all groups. +So when validating in ``contact`` group, ``$name`` can be empty but the key is +still required. If this is not the intended behavior, use the ``Optional`` +constraint explicitly instead of ``Required``. + Options ------- diff --git a/validation/raw_values.rst b/validation/raw_values.rst index 8cee65108b8..2014d37644b 100644 --- a/validation/raw_values.rst +++ b/validation/raw_values.rst @@ -105,3 +105,10 @@ The ``validate()`` method returns a :class:`Symfony\\Component\\Validator\\Const object, which acts like an array of errors. Each error in the collection is a :class:`Symfony\\Component\\Validator\\ConstraintViolation` object, which holds the error message on its ``getMessage()`` method. + +.. note:: + + When using groups with the + :doc:`Collection` constraint, be sure to + use the ``Optional`` constraint when appropriate as explained in its + reference documentation. From 64eb995d1df235b7d048bea89e4d522f0f9a7e57 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 26 Mar 2021 13:23:18 +0100 Subject: [PATCH 0061/5386] [#13492] satisfy the linter --- validation/raw_values.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/raw_values.rst b/validation/raw_values.rst index 2014d37644b..9699e5353cc 100644 --- a/validation/raw_values.rst +++ b/validation/raw_values.rst @@ -109,6 +109,6 @@ which holds the error message on its ``getMessage()`` method. .. note:: When using groups with the - :doc:`Collection` constraint, be sure to + :doc:`Collection ` constraint, be sure to use the ``Optional`` constraint when appropriate as explained in its reference documentation. From 20436fc6026621885009e6b951e14b9b43027e9d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 26 Mar 2021 14:07:27 +0100 Subject: [PATCH 0062/5386] rename master request to main request --- components/http_kernel.rst | 12 ++++++------ create_framework/http_kernel_httpkernelinterface.rst | 4 ++-- event_dispatcher.rst | 8 ++++---- http_cache.rst | 2 +- http_cache/esi.rst | 2 +- reference/configuration/framework.rst | 8 ++++---- reference/events.rst | 6 +++--- security/form_login_setup.rst | 2 +- session.rst | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/components/http_kernel.rst b/components/http_kernel.rst index c0da0fd6cfa..4dcf0ff6aa3 100644 --- a/components/http_kernel.rst +++ b/components/http_kernel.rst @@ -65,7 +65,7 @@ that system:: */ public function handle( Request $request, - int $type = self::MASTER_REQUEST, + int $type = self::MAIN_REQUEST, bool $catch = true ); } @@ -701,12 +701,12 @@ argument as follows:: This creates another full request-response cycle where this new ``Request`` is transformed into a ``Response``. The only difference internally is that some -listeners (e.g. security) may only act upon the master request. Each listener +listeners (e.g. security) may only act upon the main request. Each listener is passed some sub-class of :class:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent`, -whose :method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::isMasterRequest` -can be used to check if the current request is a "master" or "sub" request. +whose :method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::isMainRequest` +can be used to check if the current request is a "main" or "sub" request. -For example, a listener that only needs to act on the master request may +For example, a listener that only needs to act on the main request may look like this:: use Symfony\Component\HttpKernel\Event\RequestEvent; @@ -714,7 +714,7 @@ look like this:: public function onKernelRequest(RequestEvent $event) { - if (!$event->isMasterRequest()) { + if (!$event->isMainRequest()) { return; } diff --git a/create_framework/http_kernel_httpkernelinterface.rst b/create_framework/http_kernel_httpkernelinterface.rst index a5c46c8daaa..29ddcc9c124 100644 --- a/create_framework/http_kernel_httpkernelinterface.rst +++ b/create_framework/http_kernel_httpkernelinterface.rst @@ -16,7 +16,7 @@ goal by making our framework implement ``HttpKernelInterface``:: */ public function handle( Request $request, - $type = self::MASTER_REQUEST, + $type = self::MAIN_REQUEST, $catch = true ); } @@ -39,7 +39,7 @@ Update your framework so that it implements this interface:: public function handle( Request $request, - $type = HttpKernelInterface::MASTER_REQUEST, + $type = HttpKernelInterface::MAIN_REQUEST, $catch = true ) { // ... diff --git a/event_dispatcher.rst b/event_dispatcher.rst index 038a405b10b..450f23cf698 100644 --- a/event_dispatcher.rst +++ b/event_dispatcher.rst @@ -206,10 +206,10 @@ the ``EventSubscriber`` directory. Symfony takes care of the rest. Request Events, Checking Types ------------------------------ -A single page can make several requests (one master request, and then multiple +A single page can make several requests (one main request, and then multiple sub-requests - typically when :ref:`embedding controllers in templates `). For the core Symfony events, you might need to check to see if the event is for -a "master" request or a "sub request":: +a "main" request or a "sub request":: // src/EventListener/RequestListener.php namespace App\EventListener; @@ -220,8 +220,8 @@ a "master" request or a "sub request":: { public function onKernelRequest(RequestEvent $event) { - if (!$event->isMasterRequest()) { - // don't do anything if it's not the master request + if (!$event->isMainRequest()) { + // don't do anything if it's not the main request return; } diff --git a/http_cache.rst b/http_cache.rst index 9a9c7e414d3..35620d1cd76 100644 --- a/http_cache.rst +++ b/http_cache.rst @@ -155,7 +155,7 @@ header to the response. You can also use the ``trace_level`` config option and set it to either ``none``, ``short`` or ``full`` to add this information. -``short`` will add the information for the master request only. +``short`` will add the information for the main request only. It's written in a concise way that makes it easy to record the information in your server log files. For example, in Apache you can use ``%{X-Symfony-Cache}o`` in ``LogFormat`` format statements. diff --git a/http_cache/esi.rst b/http_cache/esi.rst index b23b19eda36..6108df41f49 100644 --- a/http_cache/esi.rst +++ b/http_cache/esi.rst @@ -161,7 +161,7 @@ used ``render()``. contains the ``ESI/1.0`` string anywhere. The embedded action can now specify its own caching rules entirely independently -of the master page:: +of the main page:: // src/Controller/NewsController.php namespace App\Controller; diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 9e03d3d05bd..15180619b77 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -197,7 +197,7 @@ Configuration * :ref:`dsn ` * :ref:`enabled ` * `only_exceptions`_ - * `only_master_requests`_ + * `only_main_requests`_ * `property_access`_ @@ -1244,12 +1244,12 @@ only_exceptions When this is set to ``true``, the profiler will only be enabled when an exception is thrown during the handling of the request. -only_master_requests -.................... +only_main_requests +.................. **type**: ``boolean`` **default**: ``false`` -When this is set to ``true``, the profiler will only be enabled on the master +When this is set to ``true``, the profiler will only be enabled on the main requests (and not on the subrequests). .. _profiler-dsn: diff --git a/reference/events.rst b/reference/events.rst index c55bfdcc824..75694ab1097 100644 --- a/reference/events.rst +++ b/reference/events.rst @@ -15,7 +15,7 @@ Each event dispatched by the HttpKernel component is a subclass of following information: :method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getRequestType` - Returns the *type* of the request (``HttpKernelInterface::MASTER_REQUEST`` + Returns the *type* of the request (``HttpKernelInterface::MAIN_REQUEST`` or ``HttpKernelInterface::SUB_REQUEST``). :method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getKernel` @@ -24,8 +24,8 @@ following information: :method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getRequest` Returns the current ``Request`` being handled. -:method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::isMasterRequest` - Checks if this is a master request. +:method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::isMainRequest` + Checks if this is a main request. .. _kernel-core-request: diff --git a/security/form_login_setup.rst b/security/form_login_setup.rst index 3aa01ef0972..3bc9cb94d10 100644 --- a/security/form_login_setup.rst +++ b/security/form_login_setup.rst @@ -489,7 +489,7 @@ whenever the user browses a page:: { $request = $event->getRequest(); if ( - !$event->isMasterRequest() + !$event->isMainRequest() || $request->isXmlHttpRequest() || 'app_login' === $request->attributes->get('_route') ) { diff --git a/session.rst b/session.rst index 5a3fb69c09b..0caba75894f 100644 --- a/session.rst +++ b/session.rst @@ -225,7 +225,7 @@ your ``Session`` object with the default ``AttributeBag`` by the ``NamespacedAtt public function createSession(): SessionInterface { return new Session( - $this->storageFactory->createStorage($this->requestStack->getMasterRequest()), + $this->storageFactory->createStorage($this->requestStack->getMainRequest()), $this->sessionAttributes, null, $this->usageReporter From dcb14d2989024578b2414761c5c9df15e798b3c3 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 26 Mar 2021 15:14:38 +0100 Subject: [PATCH 0063/5386] rename User to InMemoryUser --- components/security/authentication.rst | 6 +++--- security/user_provider.rst | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/security/authentication.rst b/components/security/authentication.rst index 8761e87915a..0b0e2d97f95 100644 --- a/components/security/authentication.rst +++ b/components/security/authentication.rst @@ -175,14 +175,14 @@ receives an array of encoders:: use Acme\Entity\LegacyUser; use Symfony\Component\Security\Core\Encoder\EncoderFactory; use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder; - use Symfony\Component\Security\Core\User\User; + use Symfony\Component\Security\Core\User\InMemoryUser; $defaultEncoder = new MessageDigestPasswordEncoder('sha512', true, 5000); $weakEncoder = new MessageDigestPasswordEncoder('md5', true, 1); $encoders = [ - User::class => $defaultEncoder, - LegacyUser::class => $weakEncoder, + InMemoryUser::class => $defaultEncoder, + LegacyUser::class => $weakEncoder, // ... ]; $encoderFactory = new EncoderFactory($encoders); diff --git a/security/user_provider.rst b/security/user_provider.rst index 00e7c5a58d8..491eb57e256 100644 --- a/security/user_provider.rst +++ b/security/user_provider.rst @@ -138,7 +138,7 @@ interface only requires one method: ``loadUserByUsername($username)``:: public function loadUserByUsername(string $usernameOrEmail) { $entityManager = $this->getEntityManager(); - + return $entityManager->createQuery( 'SELECT u FROM App\Entity\User u @@ -231,7 +231,7 @@ users will encode their passwords: # ... encoders: # this internal class is used by Symfony to represent in-memory users - Symfony\Component\Security\Core\User\User: 'auto' + Symfony\Component\Security\Core\User\InMemoryUser: 'auto' .. code-block:: xml @@ -249,7 +249,7 @@ users will encode their passwords: - @@ -260,7 +260,7 @@ users will encode their passwords: // config/packages/security.php // this internal class is used by Symfony to represent in-memory users - use Symfony\Component\Security\Core\User\User; + use Symfony\Component\Security\Core\User\InMemoryUser; $container->loadFromExtension('security', [ // ... @@ -417,7 +417,7 @@ command will generate a nice skeleton to get you started:: { return User::class === $class || is_subclass_of($class, User::class); } - + /** * Upgrades the encoded password of a user, typically for using a better hash algorithm. */ From 1e6d1304681e4942adf30faf9987dc1051236948 Mon Sep 17 00:00:00 2001 From: Andrii Popov Date: Sat, 27 Mar 2021 09:27:39 +0200 Subject: [PATCH 0064/5386] [Validator] Add missing backticks for constraint option names --- reference/constraints/Bic.rst | 16 +-- reference/constraints/CardScheme.rst | 8 +- reference/constraints/Choice.rst | 36 +++--- reference/constraints/Count.rst | 20 ++-- reference/constraints/DateTime.rst | 4 +- reference/constraints/DivisibleBy.rst | 4 +- reference/constraints/Email.rst | 16 +-- reference/constraints/Expression.rst | 4 +- reference/constraints/File.rst | 64 +++++------ reference/constraints/Image.rst | 108 +++++++++--------- reference/constraints/Ip.rst | 8 +- reference/constraints/Isbn.rst | 20 ++-- reference/constraints/Issn.rst | 12 +- reference/constraints/Json.rst | 4 +- reference/constraints/Length.rst | 28 ++--- reference/constraints/Locale.rst | 4 +- reference/constraints/Negative.rst | 4 +- reference/constraints/NegativeOrZero.rst | 4 +- reference/constraints/NotBlank.rst | 4 +- .../constraints/NotCompromisedPassword.rst | 12 +- reference/constraints/Positive.rst | 4 +- reference/constraints/PositiveOrZero.rst | 4 +- reference/constraints/Range.rst | 32 +++--- reference/constraints/Regex.rst | 16 +-- reference/constraints/Timezone.rst | 16 +-- reference/constraints/Type.rst | 8 +- reference/constraints/Unique.rst | 4 +- reference/constraints/UniqueEntity.rst | 24 ++-- reference/constraints/Url.rst | 20 ++-- reference/constraints/Valid.rst | 4 +- .../constraints/_normalizer-option.rst.inc | 4 +- 31 files changed, 258 insertions(+), 258 deletions(-) diff --git a/reference/constraints/Bic.rst b/reference/constraints/Bic.rst index 6496ae63d54..0d00fca6297 100644 --- a/reference/constraints/Bic.rst +++ b/reference/constraints/Bic.rst @@ -87,8 +87,8 @@ Available Options .. include:: /reference/constraints/_groups-option.rst.inc -iban -~~~~ +``iban`` +~~~~~~~~ **type**: ``string`` **default**: ``null`` @@ -98,8 +98,8 @@ iban An IBAN value to validate that its country code is the same as the BIC's one. -ibanMessage -~~~~~~~~~~~ +``ibanMessage`` +~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.`` @@ -109,8 +109,8 @@ ibanMessage The default message supplied when the value does not pass the combined BIC/IBAN check. -ibanPropertyPath -~~~~~~~~~~~~~~~~ +``ibanPropertyPath`` +~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``null`` @@ -124,8 +124,8 @@ For example, if you want to compare the ``$bic`` property of some object with regard to the ``$iban`` property of the same object, use ``ibanPropertyPath="iban"`` in the comparison constraint of ``$bic``. -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``This is not a valid Business Identifier Code (BIC).`` diff --git a/reference/constraints/CardScheme.rst b/reference/constraints/CardScheme.rst index 6362d9932ee..e8e2b744987 100644 --- a/reference/constraints/CardScheme.rst +++ b/reference/constraints/CardScheme.rst @@ -99,8 +99,8 @@ Available Options .. include:: /reference/constraints/_groups-option.rst.inc -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``Unsupported card type or invalid card number.`` @@ -116,8 +116,8 @@ Parameter Description .. include:: /reference/constraints/_payload-option.rst.inc -schemes -~~~~~~~ +``schemes`` +~~~~~~~~~~~ **type**: ``mixed`` [:ref:`default option `] diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index b1407c8add0..0e099053775 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -275,8 +275,8 @@ you can pass the class name and the method as an array. Available Options ----------------- -callback -~~~~~~~~ +``callback`` +~~~~~~~~~~~~ **type**: ``string|array|Closure`` @@ -284,8 +284,8 @@ This is a callback method that can be used instead of the `choices`_ option to return the choices array. See `Supplying the Choices with a Callback Function`_ for details on its usage. -choices -~~~~~~~ +``choices`` +~~~~~~~~~~~ **type**: ``array`` [:ref:`default option `] @@ -295,8 +295,8 @@ will be matched against this array. .. include:: /reference/constraints/_groups-option.rst.inc -max -~~~ +``max`` +~~~~~~~ **type**: ``integer`` @@ -305,8 +305,8 @@ to force no more than XX number of values to be selected. For example, if ``max`` is 3, but the input array contains 4 valid items, the validation will fail. -maxMessage -~~~~~~~~~~ +``maxMessage`` +~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``You must select at most {{ limit }} choices.`` @@ -326,8 +326,8 @@ Parameter Description The ``{{ choices }}`` parameter was introduced in Symfony 4.3. -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``The value you selected is not a valid choice.`` @@ -344,8 +344,8 @@ Parameter Description ``{{ value }}`` The current (invalid) value ================= ============================================================ -min -~~~ +``min`` +~~~~~~~ **type**: ``integer`` @@ -354,8 +354,8 @@ to force at least XX number of values to be selected. For example, if ``min`` is 3, but the input array only contains 2 valid items, the validation will fail. -minMessage -~~~~~~~~~~ +``minMessage`` +~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``You must select at least {{ limit }} choices.`` @@ -375,8 +375,8 @@ Parameter Description The ``{{ choices }}`` parameter was introduced in Symfony 4.3. -multiple -~~~~~~~~ +``multiple`` +~~~~~~~~~~~~ **type**: ``boolean`` **default**: ``false`` @@ -385,8 +385,8 @@ of a single, scalar value. The constraint will check that each value of the input array can be found in the array of valid choices. If even one of the input values cannot be found, the validation will fail. -multipleMessage -~~~~~~~~~~~~~~~ +``multipleMessage`` +~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``One or more of the given values is invalid.`` diff --git a/reference/constraints/Count.rst b/reference/constraints/Count.rst index 2ff99b5adbb..dbbe94b480a 100644 --- a/reference/constraints/Count.rst +++ b/reference/constraints/Count.rst @@ -101,8 +101,8 @@ you might add the following: Options ------- -exactMessage -~~~~~~~~~~~~ +``exactMessage`` +~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``This collection should contain exactly {{ limit }} elements.`` @@ -120,8 +120,8 @@ Parameter Description .. include:: /reference/constraints/_groups-option.rst.inc -max -~~~ +``max`` +~~~~~~~ **type**: ``integer`` @@ -130,8 +130,8 @@ collection elements count is **greater** than this max value. This option is required when the ``min`` option is not defined. -maxMessage -~~~~~~~~~~ +``maxMessage`` +~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``This collection should contain {{ limit }} elements or less.`` @@ -147,8 +147,8 @@ Parameter Description ``{{ limit }}`` The upper limit =============== ============================================================== -min -~~~ +``min`` +~~~~~~~ **type**: ``integer`` @@ -157,8 +157,8 @@ collection elements count is **less** than this min value. This option is required when the ``max`` option is not defined. -minMessage -~~~~~~~~~~ +``minMessage`` +~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``This collection should contain {{ limit }} elements or more.`` diff --git a/reference/constraints/DateTime.rst b/reference/constraints/DateTime.rst index 41b4db2acc0..c3a9c328932 100644 --- a/reference/constraints/DateTime.rst +++ b/reference/constraints/DateTime.rst @@ -84,8 +84,8 @@ Basic Usage Options ------- -format -~~~~~~ +``format`` +~~~~~~~~~~ **type**: ``string`` **default**: ``Y-m-d H:i:s`` diff --git a/reference/constraints/DivisibleBy.rst b/reference/constraints/DivisibleBy.rst index f4ae78ab0f8..73b0a9c88b6 100644 --- a/reference/constraints/DivisibleBy.rst +++ b/reference/constraints/DivisibleBy.rst @@ -104,8 +104,8 @@ Options .. include:: /reference/constraints/_groups-option.rst.inc -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``This value should be a multiple of {{ compared_value }}.`` diff --git a/reference/constraints/Email.rst b/reference/constraints/Email.rst index 5b149f0bf5f..5cbeaeb4523 100644 --- a/reference/constraints/Email.rst +++ b/reference/constraints/Email.rst @@ -92,8 +92,8 @@ Basic Usage Options ------- -checkHost -~~~~~~~~~ +``checkHost`` +~~~~~~~~~~~~~ **type**: ``boolean`` **default**: ``false`` @@ -105,8 +105,8 @@ If true, then the :phpfunction:`checkdnsrr` PHP function will be used to check the validity of the MX *or* the A *or* the AAAA record of the host of the given email. -checkMX -~~~~~~~ +``checkMX`` +~~~~~~~~~~~ **type**: ``boolean`` **default**: ``false`` @@ -124,8 +124,8 @@ check the validity of the MX record of the host of the given email. .. include:: /reference/constraints/_groups-option.rst.inc -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``This value is not a valid email address.`` @@ -139,8 +139,8 @@ Parameter Description ``{{ value }}`` The current (invalid) value =============== ============================================================== -mode -~~~~ +``mode`` +~~~~~~~~ **type**: ``string`` **default**: ``loose`` diff --git a/reference/constraints/Expression.rst b/reference/constraints/Expression.rst index f3af00f1d3a..fbcbfc9c2b2 100644 --- a/reference/constraints/Expression.rst +++ b/reference/constraints/Expression.rst @@ -264,8 +264,8 @@ Parameter Description .. include:: /reference/constraints/_payload-option.rst.inc -values -~~~~~~ +``values`` +~~~~~~~~~~ **type**: ``array`` **default**: ``[]`` diff --git a/reference/constraints/File.rst b/reference/constraints/File.rst index a865349f913..bc93caf83d1 100644 --- a/reference/constraints/File.rst +++ b/reference/constraints/File.rst @@ -158,8 +158,8 @@ have been specified. Options ------- -binaryFormat -~~~~~~~~~~~~ +``binaryFormat`` +~~~~~~~~~~~~~~~~ **type**: ``boolean`` **default**: ``null`` @@ -171,8 +171,8 @@ the value defined in the ``maxSize`` option. For more information about the difference between binary and SI prefixes, see `Wikipedia: Binary prefix`_. -disallowEmptyMessage -~~~~~~~~~~~~~~~~~~~~ +``disallowEmptyMessage`` +~~~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``An empty file is not allowed.`` @@ -190,8 +190,8 @@ Parameter Description .. include:: /reference/constraints/_groups-option.rst.inc -maxSize -~~~~~~~ +``maxSize`` +~~~~~~~~~~~ **type**: ``mixed`` @@ -212,8 +212,8 @@ Suffix Unit Name Value Example For more information about the difference between binary and SI prefixes, see `Wikipedia: Binary prefix`_. -maxSizeMessage -~~~~~~~~~~~~~~ +``maxSizeMessage`` +~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.`` @@ -231,8 +231,8 @@ Parameter Description ``{{ suffix }}`` Suffix for the used file size unit (see above) ================ ============================================================= -mimeTypes -~~~~~~~~~ +``mimeTypes`` +~~~~~~~~~~~~~ **type**: ``array`` or ``string`` @@ -256,8 +256,8 @@ You can find a list of existing mime types on the `IANA website`_. This feature was introduced in Symfony 4.4. -mimeTypesMessage -~~~~~~~~~~~~~~~~ +``mimeTypesMessage`` +~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.`` @@ -275,8 +275,8 @@ Parameter Description ``{{ types }}`` The list of allowed MIME types =============== ============================================================== -notFoundMessage -~~~~~~~~~~~~~~~ +``notFoundMessage`` +~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The file could not be found.`` @@ -292,8 +292,8 @@ Parameter Description ``{{ file }}`` Absolute file path =============== ============================================================== -notReadableMessage -~~~~~~~~~~~~~~~~~~ +``notReadableMessage`` +~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The file is not readable.`` @@ -310,8 +310,8 @@ Parameter Description .. include:: /reference/constraints/_payload-option.rst.inc -uploadCantWriteErrorMessage -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``uploadCantWriteErrorMessage`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``Cannot write temporary file to disk.`` @@ -320,8 +320,8 @@ temporary folder. This message has no parameters. -uploadErrorMessage -~~~~~~~~~~~~~~~~~~ +``uploadErrorMessage`` +~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The file could not be uploaded.`` @@ -330,8 +330,8 @@ for some unknown reason. This message has no parameters. -uploadExtensionErrorMessage -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``uploadExtensionErrorMessage`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``A PHP extension caused the upload to fail.`` @@ -340,8 +340,8 @@ fail. This message has no parameters. -uploadFormSizeErrorMessage -~~~~~~~~~~~~~~~~~~~~~~~~~~ +``uploadFormSizeErrorMessage`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The file is too large.`` @@ -350,8 +350,8 @@ by the HTML file input field. This message has no parameters. -uploadIniSizeErrorMessage -~~~~~~~~~~~~~~~~~~~~~~~~~ +``uploadIniSizeErrorMessage`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.`` @@ -367,8 +367,8 @@ Parameter Description ``{{ suffix }}`` Suffix for the used file size unit (see above) ================ ============================================================= -uploadNoFileErrorMessage -~~~~~~~~~~~~~~~~~~~~~~~~ +``uploadNoFileErrorMessage`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``No file was uploaded.`` @@ -376,8 +376,8 @@ The message that is displayed if no file was uploaded. This message has no parameters. -uploadNoTmpDirErrorMessage -~~~~~~~~~~~~~~~~~~~~~~~~~~ +``uploadNoTmpDirErrorMessage`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``No temporary folder was configured in php.ini.`` @@ -386,8 +386,8 @@ missing. This message has no parameters. -uploadPartialErrorMessage -~~~~~~~~~~~~~~~~~~~~~~~~~ +``uploadPartialErrorMessage`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The file was only partially uploaded.`` diff --git a/reference/constraints/Image.rst b/reference/constraints/Image.rst index e8b492bf4ae..8ab714db79b 100644 --- a/reference/constraints/Image.rst +++ b/reference/constraints/Image.rst @@ -230,15 +230,15 @@ This constraint shares all of its options with the :doc:`File `] diff --git a/reference/constraints/Timezone.rst b/reference/constraints/Timezone.rst index c5f27e1cbfb..3725038f0d8 100644 --- a/reference/constraints/Timezone.rst +++ b/reference/constraints/Timezone.rst @@ -86,8 +86,8 @@ string which contains any of the `PHP timezone identifiers`_ (e.g. ``America/New Options ------- -countryCode -~~~~~~~~~~~ +``countryCode`` +~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``null`` @@ -100,8 +100,8 @@ The value of this option must be a valid `ISO 3166-1 alpha-2`_ country code .. include:: /reference/constraints/_groups-option.rst.inc -intlCompatible -~~~~~~~~~~~~~~ +``intlCompatible`` +~~~~~~~~~~~~~~~~~~ **type**: ``boolean`` **default**: ``false`` @@ -114,8 +114,8 @@ timezones provided by PHP's Intl extension (because they use different ICU versions). If this option is set to ``true``, this constraint only considers valid the values compatible with the PHP ``\IntlTimeZone::createTimeZone()`` method. -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``This value is not a valid timezone.`` @@ -131,8 +131,8 @@ Parameter Description .. include:: /reference/constraints/_payload-option.rst.inc -zone -~~~~ +``zone`` +~~~~~~~~ **type**: ``string`` **default**: ``\DateTimeZone::ALL`` diff --git a/reference/constraints/Type.rst b/reference/constraints/Type.rst index 307b7565749..17ee98fec78 100644 --- a/reference/constraints/Type.rst +++ b/reference/constraints/Type.rst @@ -155,8 +155,8 @@ Options .. include:: /reference/constraints/_groups-option.rst.inc -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``This value should be of type {{ type }}.`` @@ -175,8 +175,8 @@ Parameter Description .. _reference-constraint-type-type: -type -~~~~ +``type`` +~~~~~~~~ **type**: ``string`` or ``array`` [:ref:`default option `] diff --git a/reference/constraints/Unique.rst b/reference/constraints/Unique.rst index e6acb08ea71..9d9cc0ffed2 100644 --- a/reference/constraints/Unique.rst +++ b/reference/constraints/Unique.rst @@ -94,8 +94,8 @@ Options .. include:: /reference/constraints/_groups-option.rst.inc -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``This collection should contain only unique elements.`` diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index ca0a0be28c6..f96d6d91b47 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -140,8 +140,8 @@ the uniqueness. If it's left blank, the correct entity manager will be determined for this class. For that reason, this option should probably not need to be used. -entityClass -~~~~~~~~~~~ +``entityClass`` +~~~~~~~~~~~~~~~ **type**: ``string`` @@ -151,8 +151,8 @@ inheritance mapping, you need to execute the query in a different repository. Use this option to define the fully-qualified class name (FQCN) of the Doctrine entity associated with the repository you want to use. -errorPath -~~~~~~~~~ +``errorPath`` +~~~~~~~~~~~~~ **type**: ``string`` **default**: The name of the first field in `fields`_ @@ -249,8 +249,8 @@ Consider this example: Now, the message would be bound to the ``port`` field with this configuration. -fields -~~~~~~ +``fields`` +~~~~~~~~~~ **type**: ``array`` | ``string`` [:ref:`default option `] @@ -266,8 +266,8 @@ each with a single field. .. include:: /reference/constraints/_groups-option.rst.inc -ignoreNull -~~~~~~~~~~ +``ignoreNull`` +~~~~~~~~~~~~~~ **type**: ``boolean`` **default**: ``true`` @@ -276,8 +276,8 @@ entities to have a ``null`` value for a field without failing validation. If set to ``false``, only one ``null`` value is allowed - if a second entity also has a ``null`` value, validation would fail. -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``This value is already used.`` @@ -300,8 +300,8 @@ Parameter Description .. include:: /reference/constraints/_payload-option.rst.inc -repositoryMethod -~~~~~~~~~~~~~~~~ +``repositoryMethod`` +~~~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``findBy`` diff --git a/reference/constraints/Url.rst b/reference/constraints/Url.rst index 4c9885d0147..ac230890a9a 100644 --- a/reference/constraints/Url.rst +++ b/reference/constraints/Url.rst @@ -81,8 +81,8 @@ Basic Usage Options ------- -checkDNS -~~~~~~~~ +``checkDNS`` +~~~~~~~~~~~~ **type**: ``boolean`` **default**: ``false`` @@ -163,8 +163,8 @@ option to the value of any of the ``CHECK_DNS_TYPE_*`` constants in the This option uses the :phpfunction:`checkdnsrr` PHP function to check the validity of the DNS record corresponding to the host associated with the given URL. -dnsMessage -~~~~~~~~~~ +``dnsMessage`` +~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The host could not be resolved.`` @@ -242,8 +242,8 @@ DNS check failed. .. include:: /reference/constraints/_groups-option.rst.inc -message -~~~~~~~ +``message`` +~~~~~~~~~~~ **type**: ``string`` **default**: ``This value is not a valid URL.`` @@ -324,8 +324,8 @@ Parameter Description .. include:: /reference/constraints/_payload-option.rst.inc -protocols -~~~~~~~~~ +``protocols`` +~~~~~~~~~~~~~ **type**: ``array`` **default**: ``['http', 'https']`` @@ -399,8 +399,8 @@ the ``ftp://`` type URLs to be valid, redefine the ``protocols`` array, listing } } -relativeProtocol -~~~~~~~~~~~~~~~~ +``relativeProtocol`` +~~~~~~~~~~~~~~~~~~~~ **type**: ``boolean`` **default**: ``false`` diff --git a/reference/constraints/Valid.rst b/reference/constraints/Valid.rst index 1cb992128ac..edd282fa53b 100644 --- a/reference/constraints/Valid.rst +++ b/reference/constraints/Valid.rst @@ -250,8 +250,8 @@ Options .. include:: /reference/constraints/_payload-option.rst.inc -traverse -~~~~~~~~ +``traverse`` +~~~~~~~~~~~~ **type**: ``boolean`` **default**: ``true`` diff --git a/reference/constraints/_normalizer-option.rst.inc b/reference/constraints/_normalizer-option.rst.inc index 784f915ff95..dcbba1c2da8 100644 --- a/reference/constraints/_normalizer-option.rst.inc +++ b/reference/constraints/_normalizer-option.rst.inc @@ -1,5 +1,5 @@ -normalizer -~~~~~~~~~~ +``normalizer`` +~~~~~~~~~~~~~~ **type**: a `PHP callable`_ **default**: ``null`` From c610653de3785f1e7578bf06c5b32cd234742147 Mon Sep 17 00:00:00 2001 From: Chris Maiden Date: Thu, 25 Mar 2021 11:14:31 +0000 Subject: [PATCH 0065/5386] Fix typo --- frontend/encore/versioning.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/encore/versioning.rst b/frontend/encore/versioning.rst index 0911f8d8cc3..ecea440ec75 100644 --- a/frontend/encore/versioning.rst +++ b/frontend/encore/versioning.rst @@ -7,7 +7,7 @@ Tired of deploying and having browser's cache the old version of your assets? By calling ``enableVersioning()``, each filename will now include a hash that changes whenever the *contents* of that file change (e.g. ``app.123abc.js`` instead of ``app.js``). This allows you to use aggressive caching strategies -(e.g. a far future ``Expires``) because, whenever a file change, its hash will change, +(e.g. a far future ``Expires``) because, whenever a file changes, its hash will change, ignoring any existing cache: .. code-block:: diff From 04b203118081c7714687031f3f5e9f70142a0b69 Mon Sep 17 00:00:00 2001 From: Chris Maiden Date: Thu, 25 Mar 2021 14:11:06 +0000 Subject: [PATCH 0066/5386] [CssSelector] Grammatical fix --- components/css_selector.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/css_selector.rst b/components/css_selector.rst index c8100793ab4..be68d1801ed 100644 --- a/components/css_selector.rst +++ b/components/css_selector.rst @@ -25,8 +25,8 @@ Usage component in any PHP application. Read the :ref:`Symfony Functional Tests ` article to learn about how to use it when creating Symfony tests. -Why to Use CSS selectors? -~~~~~~~~~~~~~~~~~~~~~~~~~ +Why Use CSS selectors? +~~~~~~~~~~~~~~~~~~~~~~ When you're parsing an HTML or an XML document, by far the most powerful method is `XPath`_. From 92072d936ca519203685c3eb1ace602adff68ad6 Mon Sep 17 00:00:00 2001 From: Andrii Popov Date: Fri, 19 Mar 2021 09:03:37 +0200 Subject: [PATCH 0067/5386] [Validator] Add normalizer option to Unique constraint --- reference/constraints/Unique.rst | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/reference/constraints/Unique.rst b/reference/constraints/Unique.rst index eb7b4727491..f673d2d817b 100644 --- a/reference/constraints/Unique.rst +++ b/reference/constraints/Unique.rst @@ -2,8 +2,9 @@ Unique ====== Validates that all the elements of the given collection are unique (none of them -is present more than once). Elements are compared strictly, so ``'7'`` and ``7`` -are considered different elements (a string and an integer, respectively). +is present more than once). By default elements are compared strictly, +so ``'7'`` and ``7`` are considered different elements (a string and an integer, respectively). +If you want any other comparison logic to be applied, use the `normalizer`_ option. .. seealso:: @@ -21,6 +22,7 @@ are considered different elements (a string and an integer, respectively). Applies to :ref:`property or method ` Options - `groups`_ - `message`_ + - `normalizer`_ - `payload`_ Class :class:`Symfony\\Component\\Validator\\Constraints\\Unique` Validator :class:`Symfony\\Component\\Validator\\Constraints\\UniqueValidator` @@ -123,4 +125,22 @@ Parameter Description ``{{ value }}`` The current (invalid) value ============================= ================================================ +``normalizer`` +~~~~~~~~~~~~~~ + +**type**: a `PHP callable`_ **default**: ``null`` + +.. versionadded:: 5.3 + + The ``normalizer`` option was introduced in Symfony 5.3. + +This option allows to define the PHP callable applied to each element of the given collection before +checking if the collection is valid. + +For example, you may want to pass the ``'trim'`` string to apply the +:phpfunction:`trim` PHP function to each element of the collection in order to ignore leading and trailing +whitespace during validation. + .. include:: /reference/constraints/_payload-option.rst.inc + +.. _`PHP callable`: https://www.php.net/callable From 3862669e610854ea302c5859f8755f563741dedf Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 27 Mar 2021 20:03:16 +0100 Subject: [PATCH 0068/5386] Minor tweaks --- reference/constraints/Unique.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/constraints/Unique.rst b/reference/constraints/Unique.rst index 3be82ed5da5..6b6d363acf1 100644 --- a/reference/constraints/Unique.rst +++ b/reference/constraints/Unique.rst @@ -4,7 +4,7 @@ Unique Validates that all the elements of the given collection are unique (none of them is present more than once). By default elements are compared strictly, so ``'7'`` and ``7`` are considered different elements (a string and an integer, respectively). -If you want any other comparison logic to be applied, use the `normalizer`_ option. +If you want to apply any other comparison logic, use the `normalizer`_ option. .. seealso:: @@ -134,12 +134,12 @@ Parameter Description The ``normalizer`` option was introduced in Symfony 5.3. -This option allows to define the PHP callable applied to each element of the given collection before -checking if the collection is valid. +This option defined the PHP callable applied to each element of the given +collection before checking if the collection is valid. -For example, you may want to pass the ``'trim'`` string to apply the -:phpfunction:`trim` PHP function to each element of the collection in order to ignore leading and trailing -whitespace during validation. +For example, you can pass the ``'trim'`` string to apply the :phpfunction:`trim` +PHP function to each element of the collection in order to ignore leading and +trailing whitespace during validation. .. include:: /reference/constraints/_payload-option.rst.inc From a6874e68d8710a01239b99e3499d3c127fed290a Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Sun, 28 Mar 2021 11:37:53 +0200 Subject: [PATCH 0069/5386] [Finder] Fix typo --- components/finder.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/finder.rst b/components/finder.rst index f799208558e..6952685b64f 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -214,7 +214,7 @@ Use the forward slash (i.e. ``/``) as the directory separator on all platforms, including Windows. The component makes the necessary conversion internally. The ``path()`` method accepts a string, a regular expression or an array of -strings or regulars expressions:: +strings or regular expressions:: $finder->path('foo/bar'); $finder->path('/^foo\/bar/'); From 337e25169c2a369e2a102144c3d5d11a02f3259b Mon Sep 17 00:00:00 2001 From: James Hemery Date: Sat, 23 Jan 2021 02:35:30 +0100 Subject: [PATCH 0070/5386] [Notifier] [FakeSms] Add the bridge --- notifier.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notifier.rst b/notifier.rst index 023361051c2..72afd815ac3 100644 --- a/notifier.rst +++ b/notifier.rst @@ -59,6 +59,7 @@ Service Package DSN AllMySms ``symfony/allmysms-notifier`` ``allmysms://LOGIN:APIKEY@default?from=FROM`` Clickatell ``symfony/clickatell-notifier`` ``clickatell://ACCESS_TOKEN@default?from=FROM`` Esendex ``symfony/esendex-notifier`` ``esendex://USER_NAME:PASSWORD@default?accountreference=ACCOUNT_REFERENCE&from=FROM`` +FakeSms ``symfony/fake-sms-notifier`` ``fakesms+email://MAILER_SERVICE_ID?to=TO&from=FROM`` FreeMobile ``symfony/free-mobile-notifier`` ``freemobile://LOGIN:PASSWORD@default?phone=PHONE`` GatewayApi ``symfony/gatewayapi-notifier`` ``gatewayapi://TOKEN@default?from=FROM`` Infobip ``symfony/infobip-notifier`` ``infobip://AUTH_TOKEN@HOST?from=FROM`` @@ -84,9 +85,8 @@ Twilio ``symfony/twilio-notifier`` ``twilio://SID:TOKEN@default?from= .. versionadded:: 5.3 - The Iqsms, GatewayApi, Octopush, AllMySms, Clickatell and SpotHit integrations - were introduced in Symfony 5.3. - + The Iqsms, GatewayApi, Octopush, AllMySms, Clickatell, SpotHit and FakeSms + integrations were introduced in Symfony 5.3. To enable a texter, add the correct DSN in your ``.env`` file and configure the ``texter_transports``: From 687199ee2bb22b4decbec8e8c1f7f4b4730d9de3 Mon Sep 17 00:00:00 2001 From: Guillaume Sarramegna <13528732+sarramegnag@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:06:41 +0200 Subject: [PATCH 0071/5386] Standardize built-in normalizers lists --- components/serializer.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/serializer.rst b/components/serializer.rst index f2c3285a33b..84c8ecb8a36 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -782,6 +782,9 @@ The Serializer component provides several built-in normalizers: :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer` Normalizes errors according to the API Problem spec `RFC 7807`_. +:class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer` + Normalizes a PHP object using an object that implements :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`. + .. note:: You can also create your own Normalizer to use another structure. Read more at From 3f33c81da2b1d3330d353c86af52aba5789bb205 Mon Sep 17 00:00:00 2001 From: Guilliam Xavier Date: Wed, 31 Mar 2021 11:36:34 +0200 Subject: [PATCH 0072/5386] [Validator] Fix Regex htmlPattern examples --- reference/constraints/Regex.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/constraints/Regex.rst b/reference/constraints/Regex.rst index 02a5ea8f407..c3b9a9bd5c6 100644 --- a/reference/constraints/Regex.rst +++ b/reference/constraints/Regex.rst @@ -175,12 +175,12 @@ Options This option specifies the pattern to use in the HTML5 ``pattern`` attribute. You usually don't need to specify this option because by default, the constraint will convert the pattern given in the `pattern`_ option into an HTML5 compatible -pattern. This means that the delimiters are removed (e.g. ``/[a-z]+/`` becomes -``[a-z]+``). +pattern. Notably, the delimiters are removed and the anchors are implicit (e.g. +``/^[a-z]+$/`` becomes ``[a-z]+``, and ``/[a-z]+/`` becomes ``.*[a-z]+.*``). However, there are some other incompatibilities between both patterns which cannot be fixed by the constraint. For instance, the HTML5 ``pattern`` attribute -does not support flags. If you have a pattern like ``/[a-z]+/i``, you +does not support flags. If you have a pattern like ``/^[a-z]+$/i``, you need to specify the HTML5 compatible pattern in the ``htmlPattern`` option: .. configuration-block:: @@ -197,7 +197,7 @@ need to specify the HTML5 compatible pattern in the ``htmlPattern`` option: /** * @Assert\Regex( * pattern = "/^[a-z]+$/i", - * htmlPattern = "^[a-zA-Z]+$" + * htmlPattern = "[a-zA-Z]+" * ) */ protected $name; @@ -211,7 +211,7 @@ need to specify the HTML5 compatible pattern in the ``htmlPattern`` option: name: - Regex: pattern: '/^[a-z]+$/i' - htmlPattern: '^[a-zA-Z]+$' + htmlPattern: '[a-zA-Z]+' .. code-block:: xml @@ -225,7 +225,7 @@ need to specify the HTML5 compatible pattern in the ``htmlPattern`` option: - + @@ -245,7 +245,7 @@ need to specify the HTML5 compatible pattern in the ``htmlPattern`` option: { $metadata->addPropertyConstraint('name', new Assert\Regex([ 'pattern' => '/^[a-z]+$/i', - 'htmlPattern' => '^[a-zA-Z]+$', + 'htmlPattern' => '[a-zA-Z]+', ])); } } From ebddb78293a7901799d6aeba24d80f42301c13fa Mon Sep 17 00:00:00 2001 From: Nyholm Date: Wed, 31 Mar 2021 09:24:36 +0200 Subject: [PATCH 0073/5386] [Validator] Add warning about closure not being cachable --- reference/constraints/Callback.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/constraints/Callback.rst b/reference/constraints/Callback.rst index 6985f3953e1..65a63235a73 100644 --- a/reference/constraints/Callback.rst +++ b/reference/constraints/Callback.rst @@ -251,6 +251,13 @@ constructor of the Callback constraint:: } } +.. warning:: + + Using a ``Closure`` together with annotation configuration will disable the + annotation cache for that class/property/methods because ``Closure``s cannot + be cached. For best performance, it is recommended to use a static callback + method. + Options ------- From f57055d5e95f79ee49c604ed3bd273070f773e91 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 31 Mar 2021 13:17:07 +0200 Subject: [PATCH 0074/5386] Minor tweak --- reference/constraints/Callback.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/reference/constraints/Callback.rst b/reference/constraints/Callback.rst index 65a63235a73..c917bf93412 100644 --- a/reference/constraints/Callback.rst +++ b/reference/constraints/Callback.rst @@ -254,9 +254,8 @@ constructor of the Callback constraint:: .. warning:: Using a ``Closure`` together with annotation configuration will disable the - annotation cache for that class/property/methods because ``Closure``s cannot - be cached. For best performance, it is recommended to use a static callback - method. + annotation cache for that class/property/method because ``Closure`` cannot + be cached. For best performance, it's recommended to use a static callback method. Options ------- From bf9e574c1ad2a0507639eee8a6285bf5f1776b15 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 31 Mar 2021 18:18:21 +0200 Subject: [PATCH 0075/5386] Rewording Priority Parameter Important part: Explaining how to do it in YAML and XML, to make clear that `priority` is not *limited* to annotations/attributes - but simply not necessary in YAML/XML :-) Closes https://github.com/symfony/symfony-docs/issues/13367 --- routing.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/routing.rst b/routing.rst index bf971924311..97df5e57787 100644 --- a/routing.rst +++ b/routing.rst @@ -997,11 +997,10 @@ Priority Parameter The ``priority`` parameter was introduced in Symfony 5.1 -When defining a greedy pattern that matches many routes, this may be at the -beginning of your routing collection and prevents any route defined after to be -matched. -A ``priority`` optional parameter is available in order to let you choose the -order of your routes, and it is only available when using annotations. +Symfony evaluates routes in the order they are defined. So a routing pattern +that matches many routes might prevent subsequent routes to be matched. In YAML +and XML you can control the order by moving the routes up or down inside the file. +For annotations and attributes, there is an optional ``priority`` parameter: .. configuration-block:: From af96b342256b1683aed3fcd0c648bb05110dba5c Mon Sep 17 00:00:00 2001 From: Mathias Arlaud Date: Thu, 1 Apr 2021 16:27:39 +0200 Subject: [PATCH 0076/5386] Update doc for mercure 0.5 --- notifier.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier.rst b/notifier.rst index 72afd815ac3..45507e1784a 100644 --- a/notifier.rst +++ b/notifier.rst @@ -157,7 +157,7 @@ Gitter ``symfony/gitter-notifier`` ``GITTER_DSN=gitter://TOKEN@defaul GoogleChat ``symfony/google-chat-notifier`` ``googlechat://ACCESS_KEY:ACCESS_TOKEN@default/SPACE?thread_key=THREAD_KEY`` LinkedIn ``symfony/linked-in-notifier`` ``linkedin://TOKEN:USER_ID@default`` Mattermost ``symfony/mattermost-notifier`` ``mattermost://ACCESS_TOKEN@HOST/PATH?channel=CHANNEL`` -Mercure ``symfony/mercure-notifier`` ``mercure://PUBLISHER_SERVICE_ID?topic=TOPIC`` +Mercure ``symfony/mercure-notifier`` ``mercure://HUB_ID?topic=TOPIC`` RocketChat ``symfony/rocket-chat-notifier`` ``rocketchat://TOKEN@ENDPOINT?channel=CHANNEL`` Slack ``symfony/slack-notifier`` ``slack://TOKEN@default?channel=CHANNEL`` Telegram ``symfony/telegram-notifier`` ``telegram://TOKEN@default?channel=CHAT_ID`` From 7eb064ca248c04d46d69dc168a62d0f84393c5c4 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Fri, 2 Apr 2021 14:56:31 +0200 Subject: [PATCH 0077/5386] [Lock] Remove tip about the RetryTillSaveStore --- reference/configuration/framework.rst | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 6458d77328a..d107cf804df 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -3090,18 +3090,6 @@ name Name of the lock you want to create. -.. tip:: - - If you want to use the `RetryTillSaveStore` for :ref:`non-blocking locks `, - you can do it by :doc:`decorating the store ` service: - - .. code-block:: yaml - - lock.invoice.retry_till_save.store: - class: Symfony\Component\Lock\Store\RetryTillSaveStore - decorates: lock.invoice.store - arguments: ['@.inner', 100, 50] - mailer ~~~~~~ From 9e9796bd7a04c18269531e64dae8367bd00634ad Mon Sep 17 00:00:00 2001 From: Felipy Amorim Date: Sun, 4 Apr 2021 21:41:28 -0300 Subject: [PATCH 0078/5386] remove namespace unused --- security/user_checkers.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/security/user_checkers.rst b/security/user_checkers.rst index b215191e680..a1662298276 100644 --- a/security/user_checkers.rst +++ b/security/user_checkers.rst @@ -24,7 +24,6 @@ displayed to the user:: namespace App\Security; use App\Entity\User as AppUser; - use App\Exception\AccountDeletedException; use Symfony\Component\Security\Core\Exception\AccountExpiredException; use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException; use Symfony\Component\Security\Core\User\UserCheckerInterface; From 3fe341f6c733e4d3c40d1dd44d802c5d300c8c80 Mon Sep 17 00:00:00 2001 From: Vasilij Dusko | CREATION Date: Thu, 1 Apr 2021 16:36:38 +0300 Subject: [PATCH 0079/5386] [Notifier] [LightSMS] add docs --- notifier.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notifier.rst b/notifier.rst index 72afd815ac3..e23c85aeefa 100644 --- a/notifier.rst +++ b/notifier.rst @@ -64,6 +64,7 @@ FreeMobile ``symfony/free-mobile-notifier`` ``freemobile://LOGIN:PASSWORD@defa GatewayApi ``symfony/gatewayapi-notifier`` ``gatewayapi://TOKEN@default?from=FROM`` Infobip ``symfony/infobip-notifier`` ``infobip://AUTH_TOKEN@HOST?from=FROM`` Iqsms ``symfony/iqsms-notifier`` ``iqsms://LOGIN:PASSWORD@default?from=FROM`` +LightSMS ``symfony/lightsms-notifier`` ``lightsms://LOGIN:TOKEN@default?from=PHONE`` Mobyt ``symfony/mobyt-notifier`` ``mobyt://USER_KEY:ACCESS_TOKEN@default?from=FROM`` Nexmo ``symfony/nexmo-notifier`` ``nexmo://KEY:SECRET@default?from=FROM`` Octopush ``symfony/octopush-notifier`` ``octopush://USERLOGIN:APIKEY@default?from=FROM&type=TYPE`` @@ -85,7 +86,7 @@ Twilio ``symfony/twilio-notifier`` ``twilio://SID:TOKEN@default?from= .. versionadded:: 5.3 - The Iqsms, GatewayApi, Octopush, AllMySms, Clickatell, SpotHit and FakeSms + The Iqsms, GatewayApi, Octopush, AllMySms, Clickatell, SpotHit, FakeSms and LightSMS integrations were introduced in Symfony 5.3. To enable a texter, add the correct DSN in your ``.env`` file and From 018d50ba322d5e58990918b226f0363dd0fcf541 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 31 Mar 2021 09:17:13 +0200 Subject: [PATCH 0080/5386] [Notifier][FakeChat] add docs --- notifier.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notifier.rst b/notifier.rst index e23c85aeefa..459f7d406b7 100644 --- a/notifier.rst +++ b/notifier.rst @@ -153,6 +153,7 @@ integration with these chat services: Service Package DSN ========== ================================ =========================================================================== Discord ``symfony/discord-notifier`` ``discord://TOKEN@default?webhook_id=ID`` +FakeChat ``symfony/fake-chat-notifier`` ``fakechat+email://MAILER_SERVICE_ID?to=TO&from=FROM`` Firebase ``symfony/firebase-notifier`` ``firebase://USERNAME:PASSWORD@default`` Gitter ``symfony/gitter-notifier`` ``GITTER_DSN=gitter://TOKEN@default?room_id=ROOM_ID`` GoogleChat ``symfony/google-chat-notifier`` ``googlechat://ACCESS_KEY:ACCESS_TOKEN@default/SPACE?thread_key=THREAD_KEY`` @@ -178,7 +179,7 @@ Zulip ``symfony/zulip-notifier`` ``zulip://EMAIL:TOKEN@HOST?channel .. versionadded:: 5.3 - The Gitter and Mercure integrations were introduced in Symfony 5.3. + The Gitter, Mercure and FakeChat integrations were introduced in Symfony 5.3. Chatters are configured using the ``chatter_transports`` setting: From 8e5d9bcaaee6bf5bb55b927331f470a66352f04e Mon Sep 17 00:00:00 2001 From: ferror Date: Mon, 5 Apr 2021 16:46:16 +0200 Subject: [PATCH 0081/5386] Every custom header in testing client must have HTTP prefix --- testing.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing.rst b/testing.rst index 130ed0ab2ae..d6fa9774a1b 100644 --- a/testing.rst +++ b/testing.rst @@ -1029,6 +1029,10 @@ You can also override HTTP headers on a per request basis:: 'HTTP_USER_AGENT' => 'MySuperBrowser/1.0', ]); +.. caution:: + + Every custom header must have `HTTP_` prefix. + .. tip:: The test client is available as a service in the container in the ``test`` From cc0337ca95bcdf1ecec0c3db32cfedb81e2911cd Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 6 Apr 2021 13:36:11 +0200 Subject: [PATCH 0082/5386] Added more details to the explanation --- testing.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testing.rst b/testing.rst index d6fa9774a1b..12bd6c74524 100644 --- a/testing.rst +++ b/testing.rst @@ -1031,7 +1031,10 @@ You can also override HTTP headers on a per request basis:: .. caution:: - Every custom header must have `HTTP_` prefix. + The name of your custom headers must follow the syntax defined in the + `section 4.1.18 of RFC 3875`_: replace ``-`` by ``_``, transform it into + uppercase and prefix the result with ``HTTP_``. For example, if your + header name is ``X-Session-Token``, pass ``HTTP_X_SESSION_TOKEN``. .. tip:: @@ -1128,3 +1131,4 @@ Learn more .. _`$_SERVER`: https://www.php.net/manual/en/reserved.variables.server.php .. _`data providers`: https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers .. _`code coverage analysis`: https://phpunit.readthedocs.io/en/9.1/code-coverage-analysis.html +.. _`section 4.1.18 of RFC 3875`: https://tools.ietf.org/html/rfc3875#section-4.1.18 From 0e53eb0a675ccd1f64948fd0b000016bc409be26 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 24 Mar 2021 12:19:38 +0100 Subject: [PATCH 0083/5386] update mercure documentation --- mercure.rst | 169 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 114 insertions(+), 55 deletions(-) diff --git a/mercure.rst b/mercure.rst index f32e8eee6a8..d67609f659a 100644 --- a/mercure.rst +++ b/mercure.rst @@ -159,20 +159,19 @@ service, including controllers:: namespace App\Controller; use Symfony\Component\HttpFoundation\Response; - use Symfony\Component\Mercure\PublisherInterface; + use Symfony\Component\Mercure\HubInterface; use Symfony\Component\Mercure\Update; class PublishController { - public function __invoke(PublisherInterface $publisher): Response + public function __invoke(HubInterface $hub): Response { $update = new Update( 'http://example.com/books/1', json_encode(['status' => 'OutOfStock']) ); - // The Publisher service is an invokable object - $publisher($update); + $hub->publish($update); return new Response('published!'); } @@ -297,17 +296,14 @@ by using the ``AbstractController::addLink`` helper method:: use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; - use Symfony\Component\WebLink\Link; + use Symfony\Component\Mercure\Discovery; class DiscoverController extends AbstractController { - public function __invoke(Request $request): JsonResponse + public function __invoke(Request $request, Discovery $discovery): JsonResponse { - // This parameter is automatically created by the MercureBundle - $hubUrl = $this->getParameter('mercure.default_hub'); - // Link: ; rel="mercure" - $this->addLink($request, new Link('mercure', $hubUrl)); + $discovery->addLink($request); return $this->json([ '@id' => '/books/1', @@ -346,13 +342,13 @@ of the ``Update`` constructor to ``true``:: // src/Controller/Publish.php namespace App\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; - use Symfony\Component\Mercure\PublisherInterface; use Symfony\Component\Mercure\Update; - class PublishController + class PublishController extends AbstractController { - public function __invoke(PublisherInterface $publisher): Response + public function __invoke(HubInterface $hub): Response { $update = new Update( 'http://example.com/books/1', @@ -362,7 +358,7 @@ of the ``Update`` constructor to ``true``:: // Publisher's JWT must contain this topic, a URI template it matches or * in mercure.publish or you'll get a 401 // Subscriber's JWT must contain this topic, a URI template it matches or * in mercure.subscribe to receive the update - $publisher($update); + $hub->publish($update); return new Response('private update published!'); } @@ -406,44 +402,71 @@ This cookie will be automatically sent by the web browser when connecting to the Then, the Hub will verify the validity of the provided JWT, and extract the topic selectors from it. -To generate the JWT, we'll use the ``lcobucci/jwt`` library. Install it: +add your JWT secret to the configuration as follow :: -.. code-block:: terminal +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/mercure.yaml + mercure: + hubs: + default: + url: https://mercure-hub.example.com/.well-known/mercure + jwt: + secret: '!ChangeMe!' + + .. code-block:: xml + + + + + + + + + + .. code-block:: php - $ composer require lcobucci/jwt + // config/packages/mercure.php + $container->loadFromExtension('mercure', [ + 'hubs' => [ + 'default' => [ + 'url' => 'https://mercure-hub.example.com/.well-known/mercure', + 'jwt' => [ + 'secret' => '!ChangeMe!', + ] + ], + ], + ]); And here is the controller:: // src/Controller/DiscoverController.php namespace App\Controller; - use Lcobucci\JWT\Configuration; - use Lcobucci\JWT\Signer\Hmac\Sha256; - use Lcobucci\JWT\Signer\Key; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; - use Symfony\Component\WebLink\Link; + use Symfony\Component\Mercure\Authorization; + use Symfony\Component\Mercure\Discovery; class DiscoverController extends AbstractController { - public function __invoke(Request $request): Response + public function __invoke(Request $request, Discovery $discovery, Authorization $authorization): Response { - $hubUrl = $this->getParameter('mercure.default_hub'); - $this->addLink($request, new Link('mercure', $hubUrl)); - - $key = Key\InMemory::plainText('mercure_secret_key'); // don't forget to set this parameter! Test value: !ChangeMe! - $configuration = Configuration::forSymmetricSigner(new Sha256(), $key); + $discovery->addLink($request); - $token = $configuration->builder() - ->withClaim('mercure', ['subscribe' => ["http://example.com/books/1"]]) // can also be a URI template, or * - ->getToken($configuration->signer(), $configuration->signingKey()) - ->toString(); + $response = new JsonResponse([ + '@id' => '/demo/books/1', + 'availability' => 'https://schema.org/InStock' + ]); - $response = $this->json(['@id' => '/demo/books/1', 'availability' => 'https://schema.org/InStock']); - $response->headers->set( - 'set-cookie', - sprintf('mercureAuthorization=%s; path=/.well-known/mercure; secure; httponly; SameSite=strict', $token) + $response->headers->setCookie( + $authorization->createCookie($request, ["http://example.com/books/1"]) ); return $response; @@ -459,15 +482,17 @@ Programmatically Generating The JWT Used to Publish --------------------------------------------------- Instead of directly storing a JWT in the configuration, -you can create a service that will return the token used by -the ``Publisher`` object:: +you can create a token provider that will return the token used by +the ``HubInterface`` object:: - // src/Mercure/MyJwtProvider.php + // src/Mercure/MyTokenProvider.php namespace App\Mercure; - final class MyJwtProvider + use Symfony\Component\Mercure\JWT\TokenProviderInterface; + + final class MyTokenProvider implements TokenProviderInterface { - public function __invoke(): string + public function getToken(): string { return 'the-JWT'; } @@ -484,7 +509,8 @@ Then, reference this service in the bundle configuration: hubs: default: url: https://mercure-hub.example.com/.well-known/mercure - jwt_provider: App\Mercure\MyJwtProvider + jwt: + provider: App\Mercure\MyTokenProvider .. code-block:: xml @@ -494,8 +520,9 @@ Then, reference this service in the bundle configuration: + > + + .. code-block:: php @@ -507,7 +534,9 @@ Then, reference this service in the bundle configuration: 'hubs' => [ 'default' => [ 'url' => 'https://mercure-hub.example.com/.well-known/mercure', - 'jwt_provider' => MyJwtProvider::class, + 'jwt' => [ + 'provider' => MyJwtProvider::class, + ] ], ], ]); @@ -568,29 +597,59 @@ its Mercure support. Testing -------- -During functional testing there is no need to send updates to Mercure. They will -be handled by a stub publisher:: +During unit testing there is not need to send updates to Mercure. + +You can instead make use of the `MockHub`:: + + // tests/Functional/.php + namespace App\Tests\Unit\Controller; - // tests/Functional/Fixtures/PublisherStub.php + use App\Controller\MessageController; + use Symfony\Component\Mercure\HubInterface; + use Symfony\Component\Mercure\JWT\StaticTokenProvider; + use Symfony\Component\Mercure\MockHub; + use Symfony\Component\Mercure\Update; + + class MessageControllerTest extends TestCase + { + public function testPublishing() + { + $hub = new MockHub('default', 'https://internal/.well-known/mercure', new StaticTokenProvider('foo'), function(Update $update): string { + // $this->assertTrue($update->isPrivate()); + + return 'id'; + }); + + $controller = new MessageController($hub); + + ... + } + } + +During functional testing you can instead decorate the Hub:: + + // tests/Functional/Fixtures/HubStub.php namespace App\Tests\Functional\Fixtures; - use Symfony\Component\Mercure\PublisherInterface; + use Symfony\Component\Mercure\HubInterface; use Symfony\Component\Mercure\Update; - class PublisherStub implements PublisherInterface + class HubStub implements HubInterface { - public function __invoke(Update $update): string + public function publish(Update $update): string { - return ''; + return 'id'; } + + // implement rest of HubInterface methods here } -PublisherStub decorates the default publisher service so no updates are actually -sent. Here is the PublisherStub implementation:: +HubStub decorates the default hub service so no updates are actually +sent. Here is the HubStub implementation:: # config/services_test.yaml - App\Tests\Functional\Fixtures\PublisherStub: - decorates: mercure.hub.default.publisher + App\Tests\Functional\Fixtures\HubStub: + decorates: mercure.hub.default Debugging From 09b1c98830c5712052824df30375788a2eb37881 Mon Sep 17 00:00:00 2001 From: Guillaume Sarramegna <13528732+sarramegnag@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:14:37 +0200 Subject: [PATCH 0084/5386] Standardize built-in normalizers lists --- serializer/normalizers.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/serializer/normalizers.rst b/serializer/normalizers.rst index 50352e29c85..224fb809bcc 100644 --- a/serializer/normalizers.rst +++ b/serializer/normalizers.rst @@ -27,13 +27,13 @@ Symfony includes the following normalizers but you can also * :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` to normalize PHP object using the :doc:`PropertyAccess component `; * :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeZoneNormalizer` - for :phpclass:`DateTimeZone` objects + for :phpclass:`DateTimeZone` objects; * :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` for - objects implementing the :phpclass:`DateTimeInterface` interface + objects implementing the :phpclass:`DateTimeInterface` interface; * :class:`Symfony\\Component\\Serializer\\Normalizer\\DateIntervalNormalizer` - for :phpclass:`DateInterval` objects + for :phpclass:`DateInterval` objects; * :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to - transform :phpclass:`SplFileInfo` objects in `Data URIs`_ + transform :phpclass:`SplFileInfo` objects in `Data URIs`_; * :class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer` to normalize PHP object using an object that implements :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`; @@ -43,11 +43,13 @@ Symfony includes the following normalizers but you can also * :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` to normalize PHP object using the getter and setter methods of the object; * :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer` to - normalize PHP object using `PHP reflection`_. -* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` for objects implementing the :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` interface + normalize PHP object using `PHP reflection`_; +* :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` for objects implementing the :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` interface; * :class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer` for :class:`Symfony\\Component\\ErrorHandler\\Exception\\FlattenException` objects * :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer` - to deal with objects implementing the :phpclass:`JsonSerializable` interface + to deal with objects implementing the :phpclass:`JsonSerializable` interface; +* :class:`Symfony\\Component\\Serializer\\Normalizer\\UidNormalizer` converts objects that implement :class:`Symfony\\Component\\Uid\\AbstractUid` into strings and denormalizes uuid or ulid strings to :class:`Symfony\\Component\\Uid\\Uuid` or :class:`Symfony\\Component\\Uid\\Ulid`. + .. _`Data URIs`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs .. _`PHP reflection`: https://php.net/manual/en/book.reflection.php From 6c728236ebf666002fb73fe9b5c53e6b65d3aeb9 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Tue, 6 Apr 2021 22:15:12 +0200 Subject: [PATCH 0085/5386] [HttpFoundation] Remove extra space --- components/http_foundation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 980eb597c3b..0fa78dc6439 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -633,7 +633,7 @@ handling, switching to chunked encoding instead:: use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\Stream; - $stream = new Stream('path/to/stream'); + $stream = new Stream('path/to/stream'); $response = new BinaryFileResponse($stream); .. note:: From 7388cc941f0c6bf084ecfe4de2cfb025fc00047b Mon Sep 17 00:00:00 2001 From: Nyholm Date: Tue, 9 Mar 2021 18:34:08 +0100 Subject: [PATCH 0086/5386] Init Runtime docs --- components/runtime.rst | 417 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 417 insertions(+) create mode 100644 components/runtime.rst diff --git a/components/runtime.rst b/components/runtime.rst new file mode 100644 index 00000000000..760b10397a4 --- /dev/null +++ b/components/runtime.rst @@ -0,0 +1,417 @@ +.. index:: + single: Runtime + single: Components; Runtime + +The Runtime Component +====================== + + The Runtime Component decouples the bootstrapping logic from any global state + to make sure the application can run with runtimes like PHP-FPM, ReactPHP, + Swoole etc without any changes. + +Installation +------------ + +.. code-block:: terminal + + $ composer require symfony/runtime + +.. include:: /components/require_autoload.rst.inc + +Usage +----- + +The Runtime component allows you to write front-controllers in a generic way +and with use of configuration you may change the behavior. Let's consider the +``public/index.php`` as an example. It will return a callable which will create +and return the application:: + + handle(Request::createFromGlobals())->send()``. + +To make a console application, the same bootstrap code would look like:: + + #!/usr/bin/env php + setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('Hello World'); + }); + + return $command; + }; + +``:class:`Symfony\\Component\\Console\\Application``` + Useful with console applications with more than one command. This will use the + :class:`Symfony\\Component\\Runtime\\Runner\\Symfony\\ConsoleApplicationRunner``.:: + + setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('Hello World'); + }); + + $app = new Application(); + $app->add($command); + $app->setDefaultCommand('hello', true); + + return $app; + }; + +``:class:`Symfony\\Component\\Runtime\\RunnerInterface``` + The ``RuntimeInterface`` is a way to use a custom application with the + generic Runtime.:: + + '/var/task', + ]; + + require_once dirname(__DIR__).'/vendor/autoload_runtime.php'; + + // ... + +The second way to pass an option to ``SymfonyRuntime::__construct()`` is to use +``extra.runtime.options`` in ``composer.json``. + +.. code-block:: json + + { + "require": { + "...": "..." + }, + "extra": { + "runtime": { + "options": { + "project_dir": "/var/task" + } + } + } + } + +.. note:: + + The environment variable ``APP_DEBUG`` has special support to easily + turn on and off debugging. + +Creating Your Own Runtime +------------------------- + +This is an advanced topic that describes the internals of the Runtime component. + +Using the runtime component will benefit maintainers because the bootstrap logic +could be versioned as a part of a normal package. If the application author decides +to use this component, the package maintainer of the Runtime class will have more +control and can fix bugs and add features. + +-- note:: + + Before Symfony 5.3, the boostrap logic was part of a Flex recipe. Since recipes + are rarely updated by users, bug patches would rarely be installed. + +The Runtime component is designed to be totally generic and able to run any application +outside of the global state in 6 steps: + + 1. The main entry point returns a callable (A) that wraps the application + 2. Callable (A) is passed to ``RuntimeInterface::getResolver()``, which returns a + ``ResolverInterface``. This resolver returns an array with the callable (A) + (or something that decorates the callable (A)) at index 0, and all its resolved + arguments at index 1. + 3. The callable A is invoked with its arguments, it will return an object that + represents the application (B). + 4. That object (B) is passed to ``RuntimeInterface::getRunner()``, which returns a + ``RunnerInterface``: an instance that knows how to "run" the object (B). + 5. The ``RunnerInterface::run($objectB)`` is executed and it returns the exit status + code as `int`. + 6. The PHP engine is exited with this status code. + +When creating a new runtime, there are two things to consider: First, what arguments +will the end user use? Second, what will the user's application look like? + +To create a runtime for ReactPHP, we see that no special arguments are typically +required. We will use the standard arguments provided by :class:`Symfony\\Component\\Runtime\\GenericRuntime` +by extending tha class. But a ReactPHP application will need some special logic +to run. That logic is added in a new class implementing :class:`Symfony\\Component\\Runtime\\RunnerInterface`:: + + use Psr\Http\Message\ServerRequestInterface; + use Symfony\Component\Runtime\RunnerInterface; + + class ReactPHPRunner implements RunnerInterface + { + private $application; + private $port; + + public function __construct(RequestHandlerInterface $application, int $port) + { + $this->application = $application; + $this->port = $port; + } + + public function run(): int + { + $application = $this->application; + $loop = \React\EventLoop\Factory::create(); + + $server = new \React\Http\Server($loop, function (ServerRequestInterface $request) use ($application) { + return $application->handle($request); + }); + + $socket = new \React\Socket\Server($this->port, $loop); + $server->listen($socket); + + $loop->run(); + + return 0; + } + } + +Now we should create a new :class:`Symfony\\Component\\Runtime\\RuntimeInterface` +that is using our ``ReactPHPRunner``:: + + use Symfony\Component\Runtime\GenericRuntime; + use Symfony\Component\Runtime\RunnerInterface; + + class ReactPHPRuntime extends GenericRuntime + { + private $port; + + public function __construct(array $options) + { + $this->port = $options['port'] ?? 8080; + parent::__construct($options); + } + + public function getRunner(?object $application): RunnerInterface + { + if ($application instanceof RequestHandlerInterface) { + return new ReactPHPRunner($application, $this->port); + } + + return parent::getRunner($application); + } + } + +The end user will now be able to create front controller like:: + + require_once dirname(__DIR__).'/vendor/autoload_runtime.php'; + + return function (array $context) { + return new Psr15Application(); + }; + + From 06414b72271a50303eaf138a8bc7c50b4ab0fdc2 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 12 Mar 2021 11:47:32 +0100 Subject: [PATCH 0087/5386] Apply suggestions from code review Co-authored-by: Oskar Stark --- components/runtime.rst | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/components/runtime.rst b/components/runtime.rst index 760b10397a4..86e3814ee0c 100644 --- a/components/runtime.rst +++ b/components/runtime.rst @@ -65,7 +65,7 @@ Selecting Runtimes The default Runtime is :class:`Symfony\\Component\\Runtime\\SymfonyRuntime`, it works excellent on most applications running with a webserver like Nginx and Apache, and PHP-FPM. You may change Runtime to :class:`Symfony\\Component\\Runtime\\GenericRuntime` -or a custom Runtime for Swoole or Aws Lambda. This can be done by specifying the +or a custom Runtime for Swoole or AWS Lambda. This can be done by specifying the Runtime class in the ``APP_RUNTIME`` environment variable or to specify the ``extra.runtime.class`` in ``composer.json``. @@ -82,8 +82,8 @@ Runtime class in the ``APP_RUNTIME`` environment variable or to specify the } } -Using SymfonyRuntime --------------------- +Using the SymfonyRuntime +------------------------ The :class:`Symfony\\Component\\Runtime\\RuntimeInterface` has two methods. One to get an instance of :class:`Symfony\\Component\\Runtime\\ResolverInterface` @@ -309,8 +309,8 @@ The second way to pass an option to ``SymfonyRuntime::__construct()`` is to use The environment variable ``APP_DEBUG`` has special support to easily turn on and off debugging. -Creating Your Own Runtime -------------------------- +Create Your Own Runtime +----------------------- This is an advanced topic that describes the internals of the Runtime component. @@ -319,7 +319,7 @@ could be versioned as a part of a normal package. If the application author deci to use this component, the package maintainer of the Runtime class will have more control and can fix bugs and add features. --- note:: +.. note:: Before Symfony 5.3, the boostrap logic was part of a Flex recipe. Since recipes are rarely updated by users, bug patches would rarely be installed. @@ -413,5 +413,3 @@ The end user will now be able to create front controller like:: return function (array $context) { return new Psr15Application(); }; - - From e7bacf17fae9eee8223b24a302bd1695ffefe913 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 16 Mar 2021 08:57:48 +0100 Subject: [PATCH 0088/5386] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Frei <37588173+freiondrej@users.noreply.github.com> --- components/runtime.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/runtime.rst b/components/runtime.rst index 86e3814ee0c..9c868bdc05b 100644 --- a/components/runtime.rst +++ b/components/runtime.rst @@ -41,7 +41,7 @@ the autoload files since the component includes a composer plugin. The ``autoloa will instantiate a :class:`Symfony\\Component\\Runtime\\RuntimeInterface`, its job is to take the callable and resolve the arguments (``array $context``). Then it calls the callable to get the application ``App\Kernel``. At last it will run the application, -ie calling ``$kernel->handle(Request::createFromGlobals())->send()``. +i.e. calling ``$kernel->handle(Request::createFromGlobals())->send()``. To make a console application, the same bootstrap code would look like:: From 76de97372b3fde4f2472b836542649bdef30a1fe Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Mon, 5 Apr 2021 14:22:59 +0200 Subject: [PATCH 0089/5386] [#15081] Finish the new Runtime docs --- .doctor-rst.yaml | 1 + components/runtime.rst | 287 ++++++++++++++++++++++++++--------------- 2 files changed, 182 insertions(+), 106 deletions(-) diff --git a/.doctor-rst.yaml b/.doctor-rst.yaml index 61b56614a29..388147a8281 100644 --- a/.doctor-rst.yaml +++ b/.doctor-rst.yaml @@ -101,3 +101,4 @@ whitelist: - 'provides a ``loginUser()`` method to simulate logging in in your functional' - '.. code-block:: twig' - '.. versionadded:: 3.6' # MonologBundle + - '// bin/console' diff --git a/components/runtime.rst b/components/runtime.rst index 9c868bdc05b..ae962dd18cb 100644 --- a/components/runtime.rst +++ b/components/runtime.rst @@ -7,7 +7,11 @@ The Runtime Component The Runtime Component decouples the bootstrapping logic from any global state to make sure the application can run with runtimes like PHP-FPM, ReactPHP, - Swoole etc without any changes. + Swoole, etc. without any changes. + +.. versionadded:: 5.3 + + The Runtime component was introduced in Symfony 5.3. Installation ------------ @@ -21,10 +25,10 @@ Installation Usage ----- -The Runtime component allows you to write front-controllers in a generic way -and with use of configuration you may change the behavior. Let's consider the -``public/index.php`` as an example. It will return a callable which will create -and return the application:: +The Runtime component abstracts most bootstrapping logic as so-called +*runtimes*, allowing you to write front-controllers in a generic way. +For instance, the Runtime component allows Symfony's ``public/index.php`` +to look like this:: handle(Request::createFromGlobals())->send()``. +So how does this front-controller work? At first, the special +``autoload_runtime.php`` is automatically created by the Composer plugin in +the component. This file runs the following logic: + +#. It instantiates a :class:`Symfony\\Component\\Runtime\\RuntimeInterface`; +#. The callable (returned in the file) is passed to the Runtime, whose job + is to resolve the arguments (in this example: ``array $content``); +#. Then, this callable is called to get the application (``App\Kernel``); +#. At last, the Runtime is used to run the application (i.e. calling + ``$kernel->handle(Request::createFromGlobals())->send()``). -To make a console application, the same bootstrap code would look like:: +To make a console application, the bootstrap code would look like:: #!/usr/bin/env php application; - $loop = \React\EventLoop\Factory::create(); + $loop = ReactFactory::create(); - $server = new \React\Http\Server($loop, function (ServerRequestInterface $request) use ($application) { - return $application->handle($request); - }); + // configure ReactPHP to correctly handle the PSR-15 application + $server = new ReactHttpServer( + $loop, + function (ServerRequestInterface $request) use ($application) { + return $application->handle($request); + } + ); - $socket = new \React\Socket\Server($this->port, $loop); + // start the ReactPHP server + $socket = new ReactSocketServer($this->port, $loop); $server->listen($socket); $loop->run(); @@ -380,8 +448,8 @@ to run. That logic is added in a new class implementing :class:`Symfony\\Compone } } -Now we should create a new :class:`Symfony\\Component\\Runtime\\RuntimeInterface` -that is using our ``ReactPHPRunner``:: +By extending the ``GenericRuntime``, you make sure that the application is +always using this ``ReactPHPRunner``:: use Symfony\Component\Runtime\GenericRuntime; use Symfony\Component\Runtime\RunnerInterface; @@ -402,14 +470,21 @@ that is using our ``ReactPHPRunner``:: return new ReactPHPRunner($application, $this->port); } + // if it's not a PSR-15 application, use the GenericRuntime to + // run the application (see "Resolvable Applications" above) return parent::getRunner($application); } } The end user will now be able to create front controller like:: + Date: Mon, 5 Apr 2021 18:55:04 +0200 Subject: [PATCH 0090/5386] Apply suggestions from code review Co-authored-by: Denis Brumann --- components/runtime.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/runtime.rst b/components/runtime.rst index ae962dd18cb..dc745adb5c6 100644 --- a/components/runtime.rst +++ b/components/runtime.rst @@ -45,7 +45,7 @@ So how does this front-controller work? At first, the special the component. This file runs the following logic: #. It instantiates a :class:`Symfony\\Component\\Runtime\\RuntimeInterface`; -#. The callable (returned in the file) is passed to the Runtime, whose job +#. The callable (returned by ``public/index.php``) is passed to the Runtime, whose job is to resolve the arguments (in this example: ``array $content``); #. Then, this callable is called to get the application (``App\Kernel``); #. At last, the Runtime is used to run the application (i.e. calling @@ -107,7 +107,7 @@ Use the ``APP_RUNTIME`` environment variable or by specifying the Using the Runtime ----------------- -A Runtime is resposible for passing arguments into the closure and run the +A Runtime is responsible for passing arguments into the closure and run the application returned by the closure. The :class:`Symfony\\Component\\Runtime\\SymfonyRuntime` and :class:`Symfony\\Component\\Runtime\\GenericRuntime` supports a number of arguments and different applications that you can use in your @@ -245,7 +245,7 @@ The ``GenericRuntime`` and ``SymfonyRuntime`` also support these generic applications: :class:`Symfony\\Component\\Runtime\\RunnerInterface` - The ``RuntimeInterface`` is a way to use a custom application with the + The ``RunnerInterface`` is a way to use a custom application with the generic Runtime:: Date: Wed, 7 Apr 2021 15:03:44 +0200 Subject: [PATCH 0091/5386] Fixed invalid configuration-block --- components/runtime.rst | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/components/runtime.rst b/components/runtime.rst index dc745adb5c6..75c84b0fe17 100644 --- a/components/runtime.rst +++ b/components/runtime.rst @@ -85,24 +85,18 @@ integrate with Swoole or AWS Lambda). Use the ``APP_RUNTIME`` environment variable or by specifying the ``extra.runtime.class`` in ``composer.json`` to change the Runtime class: -.. configuration-block:: - - .. code-block:: json +.. code-block:: json - { - "require": { - "...": "..." - }, - "extra": { - "runtime": { - "class": "Symfony\\Component\\Runtime\\GenericRuntime" - } + { + "require": { + "...": "..." + }, + "extra": { + "runtime": { + "class": "Symfony\\Component\\Runtime\\GenericRuntime" } } - - .. code-block:: env - - APP_RUNTIME="Symfony\\Component\\Runtime\\GenericRuntime" + } Using the Runtime ----------------- From f5ee47256a00b3f1544215bbd3b2633d2454baf1 Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Fri, 16 Oct 2020 13:17:42 +0200 Subject: [PATCH 0092/5386] [Messenger] Routing & Inheritance --- messenger.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/messenger.rst b/messenger.rst index 52f125a3b61..8b977fcd283 100644 --- a/messenger.rst +++ b/messenger.rst @@ -314,6 +314,13 @@ to multiple transports: ], ]); +.. note:: + + If you configure routing for both a child and parent class, but rules + are used. E.g. if you have an ``SmsNotification`` object that extends + from ``Notification``, both the routing for ``Notification`` and + ``SmsNotification`` will be used. + Doctrine Entities in Messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 5c20fe3a94072394baec216a5d48947f010b66e1 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 7 Apr 2021 16:14:13 +0200 Subject: [PATCH 0093/5386] [Messenger] fix typo --- messenger.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index 8b977fcd283..70944b9a2d0 100644 --- a/messenger.rst +++ b/messenger.rst @@ -316,7 +316,7 @@ to multiple transports: .. note:: - If you configure routing for both a child and parent class, but rules + If you configure routing for both a child and parent class, both rules are used. E.g. if you have an ``SmsNotification`` object that extends from ``Notification``, both the routing for ``Notification`` and ``SmsNotification`` will be used. From 5a8ce041c96a52be437f4333cf36c9b0c2c716ef Mon Sep 17 00:00:00 2001 From: Carlos Pereira De Amorim Date: Thu, 9 Jul 2020 12:50:34 +0200 Subject: [PATCH 0094/5386] Added explaination on context in events and initial marking --- workflow.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/workflow.rst b/workflow.rst index 048ea2c003a..bd36eb49014 100644 --- a/workflow.rst +++ b/workflow.rst @@ -381,11 +381,36 @@ order: * ``workflow.[workflow name].announce`` * ``workflow.[workflow name].announce.[transition name]`` + You can avoid triggering those events by using the context:: + + $workflow->apply($subject, $transitionName, [Workflow::DISABLE_ANNOUNCE_EVENT => true]); + + .. versionadded:: 5.1 + + The ``Workflow::DISABLE_ANNOUNCE_EVENT`` constant was introduced in Symfony 5.1. + + .. versionadded:: 5.2 + + In Symfony 5.2, the context is accessible in all events:: + + // $context must be an array + $context = ['context_key' => 'context_value']; + $workflow->apply($subject, $transitionName, $context); + + // in an event listener + $context = $event->getContext(); // returns ['context'] + .. note:: The leaving and entering events are triggered even for transitions that stay in same place. +.. note:: + + If you initialize the marking by calling ``$workflow->getMarking($object);``, + then the ``workflow.[workflow_name].entered.[initial_place_name]`` event will + be called with the default context (``Workflow::DEFAULT_INITIAL_CONTEXT``). + Here is an example of how to enable logging for every time a "blog_publishing" workflow leaves a place:: From 61c6a2efe64af747ffcb825e26fdc45d281c37e5 Mon Sep 17 00:00:00 2001 From: Andrius Date: Mon, 14 Dec 2020 00:18:28 +0200 Subject: [PATCH 0095/5386] Update login_link.rst --- security/login_link.rst | 82 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/security/login_link.rst b/security/login_link.rst index b92dd694178..e43edbd7a22 100644 --- a/security/login_link.rst +++ b/security/login_link.rst @@ -654,3 +654,85 @@ user create this POST request (e.g. by clicking a button):: {% endblock %} + +Customizing the Success Handler +............................... + +To customize, how the success handler behaves, create your own ``AuthenticationSuccessHandler``:: + + // src/Security/Authentication/AuthenticationSuccessHandler.php + namespace App\Security\Authentication; + + use Symfony\Component\HttpFoundation\JsonResponse; + use Symfony\Component\HttpFoundation\Request; + use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; + use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface; + + class AuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface + { + public function onAuthenticationSuccess(Request $request, TokenInterface $token): JsonResponse + { + // Example use case: Create API token for Guard Authentication. + $user = $token->getUser(); // Returns string|\Stringable|UserInterface - depends on your implementation. + + $userApiToken = $user->getApiToken(); + + return new JsonResponse(['apiToken' => 'userApiToken']); + } + } + +Modify the configuration and use your handler for the ``success_handler`` key: + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/security.yaml + security: + firewalls: + main: + login_link: + check_route: login_check + lifetime: 600 + max_uses: 1 + success_handler: App\Security\Authentication\AuthenticationSuccessHandler + + .. code-block:: xml + + + + + + + + + + + + + .. code-block:: php + + // config/packages/security.php + $container->loadFromExtension('security', [ + 'firewalls' => [ + 'main' => [ + 'login_link' => [ + 'check_route' => 'login_check', + 'lifetime' => 600, + 'max_uses' => 1, + 'success_handler' => 'App\Security\Authentication\AuthenticationSuccessHandler', + ], + ], + ], + ]); From 8680b94bd703f414735f25c18b3515a3915bcf8b Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Wed, 7 Apr 2021 16:56:32 +0200 Subject: [PATCH 0096/5386] [#14700] Minor rewording --- security/login_link.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/security/login_link.rst b/security/login_link.rst index e43edbd7a22..d3c7b0e4c23 100644 --- a/security/login_link.rst +++ b/security/login_link.rst @@ -656,9 +656,12 @@ user create this POST request (e.g. by clicking a button):: {% endblock %} Customizing the Success Handler -............................... +------------------------------- -To customize, how the success handler behaves, create your own ``AuthenticationSuccessHandler``:: +Sometimes, the default success handling does not fit your use-case (e.g. +when you need to generate and return an API key). To customize how the +success handler behaves, create your own +:class:`Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface`:: // src/Security/Authentication/AuthenticationSuccessHandler.php namespace App\Security\Authentication; @@ -672,16 +675,14 @@ To customize, how the success handler behaves, create your own ``AuthenticationS { public function onAuthenticationSuccess(Request $request, TokenInterface $token): JsonResponse { - // Example use case: Create API token for Guard Authentication. - $user = $token->getUser(); // Returns string|\Stringable|UserInterface - depends on your implementation. - + $user = $token->getUser(); $userApiToken = $user->getApiToken(); return new JsonResponse(['apiToken' => 'userApiToken']); } } -Modify the configuration and use your handler for the ``success_handler`` key: +Then, configure this service ID as the ``success_handler``: .. configuration-block:: @@ -715,7 +716,7 @@ Modify the configuration and use your handler for the ``success_handler`` key: check-post-only="true" max-uses="1" lifetime="600" - success_handler="App\Security\Authentication\AuthenticationSuccessHandler" + success-handler="App\Security\Authentication\AuthenticationSuccessHandler" /> @@ -724,6 +725,8 @@ Modify the configuration and use your handler for the ``success_handler`` key: .. code-block:: php // config/packages/security.php + use App\Security\Authentication\AuthenticationSuccessHandler; + $container->loadFromExtension('security', [ 'firewalls' => [ 'main' => [ @@ -731,7 +734,7 @@ Modify the configuration and use your handler for the ``success_handler`` key: 'check_route' => 'login_check', 'lifetime' => 600, 'max_uses' => 1, - 'success_handler' => 'App\Security\Authentication\AuthenticationSuccessHandler', + 'success_handler' => AuthenticationSuccessHandler::class, ], ], ], From e16bc4ea4180381e515095f898163faeeba04397 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Wed, 7 Apr 2021 17:02:08 +0200 Subject: [PATCH 0097/5386] [#14728] Be explicit about the double 's' --- components/cache/adapters/redis_adapter.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cache/adapters/redis_adapter.rst b/components/cache/adapters/redis_adapter.rst index bed064679e4..0845b3bcb96 100644 --- a/components/cache/adapters/redis_adapter.rst +++ b/components/cache/adapters/redis_adapter.rst @@ -63,7 +63,7 @@ helper method allows creating and configuring the Redis client class instance us The DSN can specify either an IP/host (and an optional port) or a socket path, as well as a password and a database index. To enable TLS for connections, the scheme ``redis`` must be -replaced by ``rediss``. +replaced by ``rediss`` (the second ``s`` means "secure"). .. note:: From 1834da9e971aa71870ba2fc66417d0f4ae05fc24 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Tue, 23 Feb 2021 18:57:23 +0100 Subject: [PATCH 0098/5386] Update data_collector.rst I removed the DataCollector class import because it has been replaced with the AbstractDataCollector class. --- profiler/data_collector.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/profiler/data_collector.rst b/profiler/data_collector.rst index 6e53fd5203d..ef377c47974 100644 --- a/profiler/data_collector.rst +++ b/profiler/data_collector.rst @@ -31,7 +31,6 @@ request:: use Symfony\Bundle\FrameworkBundle\DataCollector\AbstractDataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; - use Symfony\Component\HttpKernel\DataCollector\DataCollector; class RequestCollector extends AbstractDataCollector { From 55edd4857e5023321ba0143bb7b1dcc27ad8870c Mon Sep 17 00:00:00 2001 From: Thibault RICHARD Date: Sun, 28 Feb 2021 18:27:21 +0100 Subject: [PATCH 0099/5386] [Messenger] Add options for PostgreSQL LISTEN/NOTIFY support --- messenger.rst | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/messenger.rst b/messenger.rst index abf45612374..ee98b1f2e84 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1074,6 +1074,12 @@ a table named ``messenger_messages``. Or, to create the table yourself, set the ``auto_setup`` option to ``false`` and :ref:`generate a migration `. +.. caution:: + + The datetime property of the messages stored in the database uses the + timezone of the current system. This may cause issues if multiple machines + with different timezone configuration use the same storage. + The transport has a number of options: ================== ===================================== ====================== @@ -1093,11 +1099,28 @@ auto_setup Whether the table should be created automatically during send / get. true ================== ===================================== ====================== -.. caution:: +.. versionadded:: 5.1 - The datetime property of the messages stored in the database uses the - timezone of the current system. This may cause issues if multiple machines - with different timezone configuration use the same storage. + The ability to leverage PostgreSQL's LISTEN/NOTIFY was introduced + in Symfony 5.1. + +When using PostgreSQL, you have access to the following options to leverage +the `LISTEN/NOTIFY`_ feature. This allow for a more performant approach +than the default polling behavior of the Doctrine transport because +PostgreSQL will directly notify the workers when a new message is inserted +in the table. + +======================= ===================================== ====================== +Option Description Default +======================= ===================================== ====================== +use_notify Whether to use LISTEN/NOTIFY. true +check_delayed_interval The interval to check for delayed 1000 + messages, in milliseconds. + Set to 0 to disable checks. +get_notify_timeout The length of time to wait for a 0 + response when calling + ``PDO::pgsqlGetNotify```, in milliseconds. +======================= ========================================== ====================== Beanstalkd Transport ~~~~~~~~~~~~~~~~~~~~ @@ -1971,3 +1994,4 @@ Learn more .. _`Long polling`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html .. _`Visibility Timeout`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html .. _`FIFO queue`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html +.. _`LISTEN/NOTIFY`: https://www.postgresql.org/docs/current/sql-notify.html From bd0073371144f4664597be836ecd523529edd5cb Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Wed, 7 Apr 2021 17:23:37 +0200 Subject: [PATCH 0100/5386] Fixed table markup --- messenger.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/messenger.rst b/messenger.rst index ee98b1f2e84..c97efd5210f 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1110,9 +1110,9 @@ than the default polling behavior of the Doctrine transport because PostgreSQL will directly notify the workers when a new message is inserted in the table. -======================= ===================================== ====================== +======================= ========================================== ====================== Option Description Default -======================= ===================================== ====================== +======================= ========================================== ====================== use_notify Whether to use LISTEN/NOTIFY. true check_delayed_interval The interval to check for delayed 1000 messages, in milliseconds. From 91096d5fbb61cb3209e97524732191062bc11a9e Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Fri, 26 Feb 2021 19:05:50 -0500 Subject: [PATCH 0101/5386] Add serialize reference --- reference/twig_reference.rst | 23 +++++++++++++++++++++++ serializer.rst | 13 +++++++++++++ 2 files changed, 36 insertions(+) diff --git a/reference/twig_reference.rst b/reference/twig_reference.rst index 270c9c678c8..e4991845096 100644 --- a/reference/twig_reference.rst +++ b/reference/twig_reference.rst @@ -558,6 +558,29 @@ project's root directory: If the given file path is out of the project directory, a ``null`` value will be returned. +serialize +~~~~~~~~~ + +.. code-block:: twig + + {{ object|serialize(format = 'json', context = []) }} + +``object`` + **type**: ``mixed`` + +``format`` *(optional)* + **type**: ``string`` + +``context`` *(optional)* + **type**: ``array`` + +.. versionadded:: 5.3 + + The ``serialize`` filter was introduced in Symfony 5.3. + +Accepts any data that can be serialized by the :doc:`Serializer component ` +and returns a serialized string in the specified ``format``. + .. _reference-twig-tags: Tags diff --git a/serializer.rst b/serializer.rst index b4dd7e03d52..7d526ae46bc 100644 --- a/serializer.rst +++ b/serializer.rst @@ -41,6 +41,19 @@ you need it or it can be used in a controller:: } } +Or you can use the ``serialize`` Twig filter in a template: + +.. code-block:: twig + + {{ object|serialize(format = 'json') }} + +See the :doc:`twig reference ` for +more information. + +.. versionadded:: 5.3 + + A ``serialize`` filter was introduced in Symfony 5.3 that uses the Serializer component. + Adding Normalizers and Encoders ------------------------------- From 367efdb0ea5ef8648d857660623a7d59701ce36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20G=C3=B6kalp?= Date: Sat, 30 Jan 2021 18:31:32 +0300 Subject: [PATCH 0102/5386] JsonResponse content updated --- components/http_foundation.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 0fa78dc6439..449d29ea0f0 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -668,9 +668,11 @@ class, which can make this even easier:: // if you know the data to send when creating the response $response = new JsonResponse(['data' => 123]); - // if you don't know the data to send when creating the response + // if you don't know the data to send or if you want to customize the encoding options $response = new JsonResponse(); // ... + // configure any custom encoding options (if needed, it must be called before "setData()") + //$response->setEncodingOptions(JsonResponse::DEFAULT_ENCODING_OPTIONS | \JSON_PRESERVE_ZERO_FRACTION); $response->setData(['data' => 123]); // if the data to send is already encoded in JSON From 77089fa264786081748cd1d90c331784c2882b50 Mon Sep 17 00:00:00 2001 From: Nate Wiebe Date: Fri, 5 Mar 2021 15:35:03 -0500 Subject: [PATCH 0103/5386] Update docs relating to translation extraction --- translation.rst | 5 +++++ translation/debug.rst | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/translation.rst b/translation.rst index 8153d000531..b8e61251893 100644 --- a/translation.rst +++ b/translation.rst @@ -292,6 +292,8 @@ To manage these situations, Symfony follows the `ICU MessageFormat`_ syntax by using PHP's :phpclass:`MessageFormatter` class. Read more about this in :doc:`/translation/message_format`. +.. _translatable-objects: + Translatable Objects -------------------- @@ -386,6 +388,9 @@ The ``translation:update`` command looks for missing translations in: :ref:`twig.paths ` config options); * Any PHP file/class that injects or :doc:`autowires ` the ``translator`` service and makes calls to the ``trans()`` method. +* Any PHP file/class stored in the ``src/`` directory that creates + :ref:`translatable-objects` using the constructor or the ``t()`` method or calls + the ``trans()`` method. .. _translation-resource-locations: diff --git a/translation/debug.rst b/translation/debug.rst index 74e52783245..c511d7c9777 100644 --- a/translation/debug.rst +++ b/translation/debug.rst @@ -19,9 +19,10 @@ command helps you to find these missing or unused translation messages templates .. caution:: - The extractors can't find messages translated outside templates, like form - labels or controllers. Dynamic translations using variables or expressions - in templates are not detected either: + The extractors can't find messages translated outside templates (like form + labels or controllers) unless using :ref:`translatable-objects` or calling + the ``trans()`` method on a translator. Dynamic translations using variables + or expressions in templates are not detected either: .. code-block:: twig From dc9e6134441517ba520d30c060aeb70ed17e4a85 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Wed, 7 Apr 2021 17:50:50 +0200 Subject: [PATCH 0104/5386] [#15063] Added versionaddeds --- translation.rst | 5 +++++ translation/debug.rst | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/translation.rst b/translation.rst index b1e1cb619c0..4330e171c0a 100644 --- a/translation.rst +++ b/translation.rst @@ -468,6 +468,11 @@ The ``translation:update`` command looks for missing translations in: :ref:`translatable-objects` using the constructor or the ``t()`` method or calls the ``trans()`` method. +.. versionadded:: 5.3 + + Support for extracting Translatable objects has been introduced in + Symfony 5.3. + .. _translation-resource-locations: Translation Resource/File Names and Locations diff --git a/translation/debug.rst b/translation/debug.rst index c511d7c9777..cc14945dc9d 100644 --- a/translation/debug.rst +++ b/translation/debug.rst @@ -21,8 +21,9 @@ command helps you to find these missing or unused translation messages templates The extractors can't find messages translated outside templates (like form labels or controllers) unless using :ref:`translatable-objects` or calling - the ``trans()`` method on a translator. Dynamic translations using variables - or expressions in templates are not detected either: + the ``trans()`` method on a translator (since Symfony 5.3). Dynamic + translations using variables or expressions in templates are not + detected either: .. code-block:: twig From 90e6580276ba5e07a002b453c069f093daac6731 Mon Sep 17 00:00:00 2001 From: AntoineRoue <64271860+AntoineRoue@users.noreply.github.com> Date: Tue, 6 Apr 2021 20:57:34 +0200 Subject: [PATCH 0105/5386] Update framework.rst This value was not changed with https://github.com/symfony/symfony/pull/30390 --- reference/configuration/framework.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index ada92f8f25e..63e0ca7ad20 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1221,7 +1221,7 @@ The value can be one of: ``true`` Throw an exception when the requirements are not met; ``false`` - Disable exceptions when the requirements are not met and return ``null`` + Disable exceptions when the requirements are not met and return ``''`` instead; ``null`` Disable checking the requirements (thus, match the route even when the From bdb8a80215972b4b85cbb957fb70241e9391f3e8 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 8 Apr 2021 11:48:23 +0200 Subject: [PATCH 0106/5386] Rename LightSms package Follows https://github.com/symfony/symfony/pull/40736 --- notifier.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifier.rst b/notifier.rst index b5c9d8eda80..488ed973a5a 100644 --- a/notifier.rst +++ b/notifier.rst @@ -64,7 +64,7 @@ FreeMobile ``symfony/free-mobile-notifier`` ``freemobile://LOGIN:PASSWORD@defa GatewayApi ``symfony/gatewayapi-notifier`` ``gatewayapi://TOKEN@default?from=FROM`` Infobip ``symfony/infobip-notifier`` ``infobip://AUTH_TOKEN@HOST?from=FROM`` Iqsms ``symfony/iqsms-notifier`` ``iqsms://LOGIN:PASSWORD@default?from=FROM`` -LightSMS ``symfony/lightsms-notifier`` ``lightsms://LOGIN:TOKEN@default?from=PHONE`` +LightSms ``symfony/light-sms-notifier`` ``lightsms://LOGIN:TOKEN@default?from=PHONE`` Mobyt ``symfony/mobyt-notifier`` ``mobyt://USER_KEY:ACCESS_TOKEN@default?from=FROM`` Nexmo ``symfony/nexmo-notifier`` ``nexmo://KEY:SECRET@default?from=FROM`` Octopush ``symfony/octopush-notifier`` ``octopush://USERLOGIN:APIKEY@default?from=FROM&type=TYPE`` @@ -86,7 +86,7 @@ Twilio ``symfony/twilio-notifier`` ``twilio://SID:TOKEN@default?from= .. versionadded:: 5.3 - The Iqsms, GatewayApi, Octopush, AllMySms, Clickatell, SpotHit, FakeSms and LightSMS + The Iqsms, GatewayApi, Octopush, AllMySms, Clickatell, SpotHit, FakeSms and LightSms integrations were introduced in Symfony 5.3. To enable a texter, add the correct DSN in your ``.env`` file and From 2204e13626a8a06c78654de002601355b616f134 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 8 Apr 2021 12:34:13 +0200 Subject: [PATCH 0107/5386] Remove variable --- notifier.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier.rst b/notifier.rst index b5c9d8eda80..987afd08f8a 100644 --- a/notifier.rst +++ b/notifier.rst @@ -155,7 +155,7 @@ Service Package DSN Discord ``symfony/discord-notifier`` ``discord://TOKEN@default?webhook_id=ID`` FakeChat ``symfony/fake-chat-notifier`` ``fakechat+email://MAILER_SERVICE_ID?to=TO&from=FROM`` Firebase ``symfony/firebase-notifier`` ``firebase://USERNAME:PASSWORD@default`` -Gitter ``symfony/gitter-notifier`` ``GITTER_DSN=gitter://TOKEN@default?room_id=ROOM_ID`` +Gitter ``symfony/gitter-notifier`` ``gitter://TOKEN@default?room_id=ROOM_ID`` GoogleChat ``symfony/google-chat-notifier`` ``googlechat://ACCESS_KEY:ACCESS_TOKEN@default/SPACE?thread_key=THREAD_KEY`` LinkedIn ``symfony/linked-in-notifier`` ``linkedin://TOKEN:USER_ID@default`` Mattermost ``symfony/mattermost-notifier`` ``mattermost://ACCESS_TOKEN@HOST/PATH?channel=CHANNEL`` From 9e1e0a906038a705bfe377706b95656873120df7 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 6 Apr 2021 14:23:37 +0200 Subject: [PATCH 0108/5386] [Notifier] Add MicrosoftTeams --- notifier.rst | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/notifier.rst b/notifier.rst index e07794be445..b260b58b58a 100644 --- a/notifier.rst +++ b/notifier.rst @@ -149,22 +149,23 @@ The chat channel is used to send chat messages to users by using :class:`Symfony\\Component\\Notifier\\Chatter` classes. Symfony provides integration with these chat services: -========== ================================ =========================================================================== -Service Package DSN -========== ================================ =========================================================================== -Discord ``symfony/discord-notifier`` ``discord://TOKEN@default?webhook_id=ID`` -FakeChat ``symfony/fake-chat-notifier`` ``fakechat+email://MAILER_SERVICE_ID?to=TO&from=FROM`` -Firebase ``symfony/firebase-notifier`` ``firebase://USERNAME:PASSWORD@default`` -Gitter ``symfony/gitter-notifier`` ``gitter://TOKEN@default?room_id=ROOM_ID`` -GoogleChat ``symfony/google-chat-notifier`` ``googlechat://ACCESS_KEY:ACCESS_TOKEN@default/SPACE?thread_key=THREAD_KEY`` -LinkedIn ``symfony/linked-in-notifier`` ``linkedin://TOKEN:USER_ID@default`` -Mattermost ``symfony/mattermost-notifier`` ``mattermost://ACCESS_TOKEN@HOST/PATH?channel=CHANNEL`` -Mercure ``symfony/mercure-notifier`` ``mercure://HUB_ID?topic=TOPIC`` -RocketChat ``symfony/rocket-chat-notifier`` ``rocketchat://TOKEN@ENDPOINT?channel=CHANNEL`` -Slack ``symfony/slack-notifier`` ``slack://TOKEN@default?channel=CHANNEL`` -Telegram ``symfony/telegram-notifier`` ``telegram://TOKEN@default?channel=CHAT_ID`` -Zulip ``symfony/zulip-notifier`` ``zulip://EMAIL:TOKEN@HOST?channel=CHANNEL`` -========== ================================ =========================================================================== +============== ==================================== =========================================================================== +Service Package DSN +============== ==================================== =========================================================================== +Discord ``symfony/discord-notifier`` ``discord://TOKEN@default?webhook_id=ID`` +FakeChat ``symfony/fake-chat-notifier`` ``fakechat+email://MAILER_SERVICE_ID?to=TO&from=FROM`` +Firebase ``symfony/firebase-notifier`` ``firebase://USERNAME:PASSWORD@default`` +Gitter ``symfony/gitter-notifier`` ``gitter://TOKEN@default?room_id=ROOM_ID`` +GoogleChat ``symfony/google-chat-notifier`` ``googlechat://ACCESS_KEY:ACCESS_TOKEN@default/SPACE?thread_key=THREAD_KEY`` +LinkedIn ``symfony/linked-in-notifier`` ``linkedin://TOKEN:USER_ID@default`` +Mattermost ``symfony/mattermost-notifier`` ``mattermost://ACCESS_TOKEN@HOST/PATH?channel=CHANNEL`` +Mercure ``symfony/mercure-notifier`` ``mercure://HUB_ID?topic=TOPIC`` +MicrosoftTeams ``symfony/microsoft-teams-notifier`` ``microsoftteams://default/PATH`` +RocketChat ``symfony/rocket-chat-notifier`` ``rocketchat://TOKEN@ENDPOINT?channel=CHANNEL`` +Slack ``symfony/slack-notifier`` ``slack://TOKEN@default?channel=CHANNEL`` +Telegram ``symfony/telegram-notifier`` ``telegram://TOKEN@default?channel=CHAT_ID`` +Zulip ``symfony/zulip-notifier`` ``zulip://EMAIL:TOKEN@HOST?channel=CHANNEL`` +============== ==================================== =========================================================================== .. versionadded:: 5.1 @@ -179,7 +180,7 @@ Zulip ``symfony/zulip-notifier`` ``zulip://EMAIL:TOKEN@HOST?channel .. versionadded:: 5.3 - The Gitter, Mercure and FakeChat integrations were introduced in Symfony 5.3. + The Gitter, Mercure, FakeChat and Microsoft Teams integrations were introduced in Symfony 5.3. Chatters are configured using the ``chatter_transports`` setting: From 0c57c73506ccc7663f618cfe69766cdd3f724fa4 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Thu, 8 Apr 2021 13:16:41 +0200 Subject: [PATCH 0109/5386] Add troubleshooting for parallel merges to maintainer guide --- _build/maintainer_guide.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/_build/maintainer_guide.rst b/_build/maintainer_guide.rst index f5913a8e811..8485bc3191d 100644 --- a/_build/maintainer_guide.rst +++ b/_build/maintainer_guide.rst @@ -352,6 +352,26 @@ forgot to merge as ``gh merge NNNNN -s 5.1`` to change the merge branch. Solutio $ git merge 5.1 $ ... +Merging while the target branch changed +....................................... + +Sometimes, someone else merges a PR in ``5.x`` at the same time as you are +doing it. In these cases, ``gh merge ...`` failes to push. Solve this by +resetting your local branch and restarting the merge: + +.. code-block:: terminal + + $ gh merge ... + # this failed + + # fetch the updated 5.x branch from GitHub + $ git fetch upstream + $ git checkout 5.x + $ git reset --hard upstream/5.x + + # restart the merge + $ gh merge ... + .. _`symfony/symfony-docs`: https://github.com/symfony/symfony-docs .. _`Symfony Docs team`: https://github.com/orgs/symfony/teams/team-symfony-docs .. _`Symfony's respectful review comments`: https://symfony.com/doc/current/contributing/community/review-comments.html From f68ec043011cc63df61541f5758dd70b198117e5 Mon Sep 17 00:00:00 2001 From: Matthew Setter Date: Thu, 8 Apr 2021 09:54:26 +0200 Subject: [PATCH 0110/5386] Corrected minor grammar mistake in the routing docs --- routing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routing.rst b/routing.rst index bf971924311..bd3697451a4 100644 --- a/routing.rst +++ b/routing.rst @@ -2216,8 +2216,8 @@ Stateless Routes The ``stateless`` option was introduced in Symfony 5.1. Sometimes, when an HTTP response should be cached, it is important to ensure -that can happen. However, whenever session is started during a request, Symfony -turns the response into a private non-cacheable response. +that can happen. However, whenever a session is started during a request, +Symfony turns the response into a private non-cacheable response. For details, see :doc:`/http_cache`. From c8deb3d013d486e99016d0918cd125180dcac555 Mon Sep 17 00:00:00 2001 From: Cristoforo Cervino Date: Tue, 16 Mar 2021 14:19:06 +0100 Subject: [PATCH 0111/5386] add form_attr option doc --- reference/forms/types/form.rst | 3 +++ .../forms/types/options/form_attr.rst.inc | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 reference/forms/types/options/form_attr.rst.inc diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index 9e1a5d47227..43a5a398bdf 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -19,6 +19,7 @@ on all types for which ``FormType`` is the parent. | | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `extra_fields_message`_ | +| | - `form_attr`_ | | | - `help`_ | | | - `help_attr`_ | | | - `help_html`_ | @@ -116,6 +117,8 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/extra_fields_message.rst.inc +.. include:: /reference/forms/types/options/form_attr.rst.inc + .. include:: /reference/forms/types/options/help.rst.inc .. include:: /reference/forms/types/options/help_attr.rst.inc diff --git a/reference/forms/types/options/form_attr.rst.inc b/reference/forms/types/options/form_attr.rst.inc new file mode 100644 index 00000000000..bb6cb1ca4fd --- /dev/null +++ b/reference/forms/types/options/form_attr.rst.inc @@ -0,0 +1,20 @@ +``form_attr`` +~~~~~~~~~~~~~ + +**type**: ``boolean`` or ``string`` **default**: ``false`` + +When ``true`` and used on a form element, it adds a `"form" attribute`_ to its HTML field representation with +its HTML form id. By doing this, a form element can be rendered outside the HTML form while still working as expected:: + + $builder->add('body', TextareaType::class, [ + 'form_attr' => true, + ]); + +This can be useful when you need to solve nested form problems. +You can also set this to ``true`` on a root form to automatically set the "form" attribute on all its children. + +.. note:: + + When the root form has no ID, ``form_attr`` is required to be a string identifier to be used as the form ID. + +.. _`"form" attribute`: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fae-form From d0d10f6f8b7faf5c1a19aa6dc2da0a671fcce427 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Sat, 3 Apr 2021 19:04:59 +0200 Subject: [PATCH 0112/5386] Adding typehint ...from https://symfony.com/doc/current/security/guard_authentication.html#the-guard-authenticator-methods --- security/guard_authentication.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index 6949d008d8d..4a406239aed 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -187,7 +187,7 @@ This requires you to implement several methods:: return true; } - public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey) + public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $providerKey) { // on success, let the request continue return null; From 5cdeedc73d7b32d48fce220b5bea5f57395658bc Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Fri, 9 Apr 2021 08:55:04 +0200 Subject: [PATCH 0113/5386] Fix: Build --- security/login_link.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/login_link.rst b/security/login_link.rst index d3c7b0e4c23..456cfc706c6 100644 --- a/security/login_link.rst +++ b/security/login_link.rst @@ -661,7 +661,7 @@ Customizing the Success Handler Sometimes, the default success handling does not fit your use-case (e.g. when you need to generate and return an API key). To customize how the success handler behaves, create your own -:class:`Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface`:: +:class:`Symfony\\Component\\Security\\Http\\Authentication\\AuthenticationSuccessHandlerInterface`:: // src/Security/Authentication/AuthenticationSuccessHandler.php namespace App\Security\Authentication; From 3833bbac0e74d4a948e4bcd0cc80b0a42ddc65c3 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 8 Apr 2021 14:40:46 +0200 Subject: [PATCH 0114/5386] [Notifier] [FakeSms] [FakeChat] Update DSN --- notifier.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifier.rst b/notifier.rst index b260b58b58a..305c433f53d 100644 --- a/notifier.rst +++ b/notifier.rst @@ -59,7 +59,7 @@ Service Package DSN AllMySms ``symfony/allmysms-notifier`` ``allmysms://LOGIN:APIKEY@default?from=FROM`` Clickatell ``symfony/clickatell-notifier`` ``clickatell://ACCESS_TOKEN@default?from=FROM`` Esendex ``symfony/esendex-notifier`` ``esendex://USER_NAME:PASSWORD@default?accountreference=ACCOUNT_REFERENCE&from=FROM`` -FakeSms ``symfony/fake-sms-notifier`` ``fakesms+email://MAILER_SERVICE_ID?to=TO&from=FROM`` +FakeSms ``symfony/fake-sms-notifier`` ``fakesms+email://default?to=TO&from=FROM`` FreeMobile ``symfony/free-mobile-notifier`` ``freemobile://LOGIN:PASSWORD@default?phone=PHONE`` GatewayApi ``symfony/gatewayapi-notifier`` ``gatewayapi://TOKEN@default?from=FROM`` Infobip ``symfony/infobip-notifier`` ``infobip://AUTH_TOKEN@HOST?from=FROM`` @@ -153,7 +153,7 @@ integration with these chat services: Service Package DSN ============== ==================================== =========================================================================== Discord ``symfony/discord-notifier`` ``discord://TOKEN@default?webhook_id=ID`` -FakeChat ``symfony/fake-chat-notifier`` ``fakechat+email://MAILER_SERVICE_ID?to=TO&from=FROM`` +FakeChat ``symfony/fake-chat-notifier`` ``fakechat+email://default?to=TO&from=FROM`` Firebase ``symfony/firebase-notifier`` ``firebase://USERNAME:PASSWORD@default`` Gitter ``symfony/gitter-notifier`` ``gitter://TOKEN@default?room_id=ROOM_ID`` GoogleChat ``symfony/google-chat-notifier`` ``googlechat://ACCESS_KEY:ACCESS_TOKEN@default/SPACE?thread_key=THREAD_KEY`` From 9a69cac3322dc410d4bbfb2a5f53d33f332de1d7 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 25 Feb 2021 09:01:54 +0100 Subject: [PATCH 0115/5386] [Intl] Remove documentation about deprecated code --- components/intl.rst | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/components/intl.rst b/components/intl.rst index cb120034615..5331097be01 100644 --- a/components/intl.rst +++ b/components/intl.rst @@ -6,12 +6,11 @@ The Intl Component ================== This component provides access to the localization data of the `ICU library`_. - It also provides a PHP replacement layer for the C `intl extension`_. .. caution:: The replacement layer is limited to the ``en`` locale. If you want to use - other locales, you should `install the intl extension`_. There is no conflict + other locales, you should `install the intl extension`_. There is no conflict between the two because, even if you use the extension, this package can still be useful to access the ICU data. @@ -30,30 +29,6 @@ Installation .. include:: /components/require_autoload.rst.inc -If you install the component via Composer, the following classes and functions -of the intl extension will be automatically provided if the intl extension is -not loaded: - -* :phpclass:`Collator` -* :phpclass:`IntlDateFormatter` -* :phpclass:`Locale` -* :phpclass:`NumberFormatter` -* :phpfunction:`intl_error_name` -* :phpfunction:`intl_is_failure` -* :phpfunction:`intl_get_error_code` -* :phpfunction:`intl_get_error_message` - -When the intl extension is not available, the following classes are used to -replace the intl classes: - -* :class:`Symfony\\Component\\Intl\\Collator\\Collator` -* :class:`Symfony\\Component\\Intl\\DateFormatter\\IntlDateFormatter` -* :class:`Symfony\\Component\\Intl\\Locale\\Locale` -* :class:`Symfony\\Component\\Intl\\NumberFormatter\\NumberFormatter` -* :class:`Symfony\\Component\\Intl\\Globals\\IntlGlobals` - -Composer automatically exposes these classes in the global namespace. - Accessing ICU Data ------------------ @@ -211,9 +186,9 @@ Locales ~~~~~~~ A locale is the combination of a language, a region and some parameters that -define the interface preferences of the user. For example, "Chinese" is the -language and ``zh_Hans_MO`` is the locale for "Chinese" (language) + "Simplified" -(script) + "Macau SAR China" (region). The ``Locales`` class provides access to +define the interface preferences of the user. For example, "Chinese" is the +language and ``zh_Hans_MO`` is the locale for "Chinese" (language) + "Simplified" +(script) + "Macau SAR China" (region). The ``Locales`` class provides access to the name of all locales:: use Symfony\Component\Intl\Locales; @@ -375,7 +350,6 @@ Learn more /reference/forms/types/locale /reference/forms/types/timezone -.. _intl extension: https://www.php.net/manual/en/book.intl.php .. _install the intl extension: https://www.php.net/manual/en/intl.setup.php .. _ICU library: http://site.icu-project.org/ .. _`Unicode ISO 15924 Registry`: https://www.unicode.org/iso15924/iso15924-codes.html From f9c37de16ef72f750eac88ec93feb9c1a6f893ca Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Apr 2021 10:38:39 +0200 Subject: [PATCH 0116/5386] [Serializer] Document the csv_end_of_line option --- components/serializer.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/serializer.rst b/components/serializer.rst index 580f55aa613..6eac8eebd51 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -984,6 +984,8 @@ Option Description D ``csv_delimiter`` Sets the field delimiter separating values (one ``,`` character only) ``csv_enclosure`` Sets the field enclosure (one character only) ``"`` +``csv_end_of_line`` Sets the character(s) used to mark the end of each ``\n`` + line in the CSV file ``csv_escape_char`` Sets the escape character (at most one character) empty string ``csv_key_separator`` Sets the separator for array's keys during its ``.`` flattening @@ -1000,6 +1002,10 @@ Option Description D ``output_utf8_bom`` Outputs special `UTF-8 BOM`_ along with encoded data ``false`` ======================= ===================================================== ========================== +.. versionadded:: 5.3 + + The ``csv_end_of_line`` option was introduced in Symfony 5.3. + The ``XmlEncoder`` ~~~~~~~~~~~~~~~~~~ From 60d3a1b335040c55dbaa7e2db485e15515ef8766 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Sun, 11 Apr 2021 13:12:35 +0200 Subject: [PATCH 0117/5386] [HttpFoundation] Fix IpUtils example This PR fixes a small bug in the IpUtils class name. --- components/http_foundation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 449d29ea0f0..cbb1742dad1 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -331,11 +331,11 @@ analysis purposes. Use the ``anonymize()`` method from the use Symfony\Component\HttpFoundation\IpUtils; $ipv4 = '123.234.235.236'; - $anonymousIpv4 = IPUtils::anonymize($ipv4); + $anonymousIpv4 = IpUtils::anonymize($ipv4); // $anonymousIpv4 = '123.234.235.0' $ipv6 = '2a01:198:603:10:396e:4789:8e99:890f'; - $anonymousIpv6 = IPUtils::anonymize($ipv6); + $anonymousIpv6 = IpUtils::anonymize($ipv6); // $anonymousIpv6 = '2a01:198:603:10::' Accessing other Data From 2a39702c83eb46fc496f487bb1955639a737a119 Mon Sep 17 00:00:00 2001 From: Sebastian Paczkowski <74934099+sebpacz@users.noreply.github.com> Date: Sun, 11 Apr 2021 13:23:04 +0200 Subject: [PATCH 0118/5386] [HttpFoundation] Minor fixes --- components/http_foundation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 3699eb17258..410fcd2272a 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -190,7 +190,7 @@ Finally, the raw data sent with the request body can be accessed using $content = $request->getContent(); -For instance, this may be useful to process a XML string sent to the +For instance, this may be useful to process an XML string sent to the application by a remote service using the HTTP POST method. If the request body is a JSON string, it can be accessed using @@ -519,7 +519,7 @@ call:: 's_maxage' => 600, 'immutable' => true, 'last_modified' => new \DateTime(), - 'etag' => 'abcdef' + 'etag' => 'abcdef', ]); .. versionadded:: 5.1 From cc800ddfb486ff60d8ea2a8cf603f9657821f5ea Mon Sep 17 00:00:00 2001 From: Martin Bens Date: Mon, 12 Apr 2021 01:18:39 +0200 Subject: [PATCH 0119/5386] Tip added to explain how to use HttpClient options in BrowserKit requests. --- components/browser_kit.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/browser_kit.rst b/components/browser_kit.rst index 76c0e33d5e1..764e42e0e2b 100644 --- a/components/browser_kit.rst +++ b/components/browser_kit.rst @@ -317,6 +317,12 @@ dedicated web crawler or scraper such as `Goutte`_:: '.table-list-header-toggle a:nth-child(1)' )->text()); +.. tip:: + + You can also use HTTP client options like 'ciphers', 'auth_basic' and 'query'. + They have to be passed as the default options argument to the client, + which is used by the HTTP browser. + .. versionadded:: 4.3 The feature to make external HTTP requests was introduced in Symfony 4.3. From a9890170c674d9be585c043ab628913eac1cbd28 Mon Sep 17 00:00:00 2001 From: Anatoly Pashin Date: Mon, 12 Apr 2021 16:48:28 +1000 Subject: [PATCH 0120/5386] [Runtime] Fix typo --- components/runtime.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/runtime.rst b/components/runtime.rst index 75c84b0fe17..2bdad2e38f5 100644 --- a/components/runtime.rst +++ b/components/runtime.rst @@ -142,7 +142,7 @@ The following arguments are supported by the ``SymfonyRuntime``: ``Command::setCode()``). And these arguments are supported by both the ``SymfonyRuntime`` and -``GenerGenericRuntime`` (both type and variable name are important): +``GenericRuntime`` (both type and variable name are important): ``array $context`` This is the same as ``$_SERVER`` + ``$_ENV``. From 24c07cc105ebc887db74e92b654057a3b165a56f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Apr 2021 10:57:10 +0200 Subject: [PATCH 0121/5386] [Security] Document the login_throttling.interval option --- security.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/security.rst b/security.rst index 3b1c81f8b20..13153307ad1 100644 --- a/security.rst +++ b/security.rst @@ -500,6 +500,11 @@ You must enable this using the ``login_throttling`` setting: login_throttling: max_attempts: 3 + # configure the maximum login attempts in a custom period of time + login_throttling: + max_attempts: 3 + interval: '15 minutes' + # use a custom rate limiter via its service ID login_throttling: limiter: app.my_login_rate_limiter @@ -526,6 +531,9 @@ You must enable this using the ``login_throttling`` setting: + + + @@ -550,6 +558,12 @@ You must enable this using the ``login_throttling`` setting: 'max_attempts' => 3, ], + // configure the maximum login attempts in a custom period of time + 'login_throttling' => [ + 'max_attempts' => 3, + 'interval' => '15 minutes', + ], + // use a custom rate limiter via its service ID 'login_throttling' => [ 'limiter' => 'app.my_login_rate_limiter', @@ -558,6 +572,10 @@ You must enable this using the ``login_throttling`` setting: ], ]); +.. versionadded:: 5.3 + + The ``login_throttling.interval`` option was introduced in Symfony 5.3. + By default, login attempts are limited on ``max_attempts`` (default: 5) failed requests for ``IP address + username`` and ``5 * max_attempts`` failed requests for ``IP address``. The second limit protects against an From 98b620676a23275b4bb12823398bab2fa1a8b9a4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Apr 2021 13:05:33 +0200 Subject: [PATCH 0122/5386] [Uid] Document the ::from() methods for UUIDs and ULIDs --- components/uid.rst | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/components/uid.rst b/components/uid.rst index 1bf66021fe1..b262768195a 100644 --- a/components/uid.rst +++ b/components/uid.rst @@ -71,12 +71,20 @@ to create each type of UUID:: The ``Uuid::NAMESPACE_*`` constants were introduced in Symfony 5.3. -If your UUID is generated by another system, use the ``fromString()`` method to -create an object and make use of the utilities available for Symfony UUIDs:: +If your UUID value is already generated in another format, use any of the +following methods to create a ``Uuid`` object from it:: - // this value is generated somewhere else (can also be in binary format) - $uuidValue = 'd9e7a184-5d5b-11ea-a62a-3499710062d0'; - $uuid = Uuid::fromString($uuidValue); + // all the following examples would generate the same Uuid object + $uuid = Uuid::fromString('d9e7a184-5d5b-11ea-a62a-3499710062d0'); + $uuid = Uuid::fromBinary("\xd9\xe7\xa1\x84\x5d\x5b\x11\xea\xa6\x2a\x34\x99\x71\x00\x62\xd0"); + $uuid = Uuid::fromBase32('6SWYGR8QAV27NACAHMK5RG0RPG'); + $uuid = Uuid::fromBase58('TuetYWNHhmuSQ3xPoVLv9M'); + $uuid = Uuid::fromRfc4122('d9e7a184-5d5b-11ea-a62a-3499710062d0'); + +.. versionadded:: 5.3 + + The ``fromBinary()``, ``fromBase32()``, ``fromBase58()`` and ``fromRfc4122()`` + methods were introduced in Symfony 5.3. Converting UUIDs ~~~~~~~~~~~~~~~~ @@ -85,7 +93,7 @@ Use these methods to transform the UUID object into different bases:: $uuid = Uuid::fromString('d9e7a184-5d5b-11ea-a62a-3499710062d0'); - $uuid->toBinary(); // string(16) "..." (binary contents can't be printed) + $uuid->toBinary(); // string(16) "\xd9\xe7\xa1\x84\x5d\x5b\x11\xea\xa6\x2a\x34\x99\x71\x00\x62\xd0" $uuid->toBase32(); // string(26) "6SWYGR8QAV27NACAHMK5RG0RPG" $uuid->toBase58(); // string(22) "TuetYWNHhmuSQ3xPoVLv9M" $uuid->toRfc4122(); // string(36) "d9e7a184-5d5b-11ea-a62a-3499710062d0" @@ -238,12 +246,20 @@ Instantiate the ``Ulid`` class to generate a random ULID value:: $ulid = new Ulid(); // e.g. 01AN4Z07BY79KA1307SR9X4MV3 -If your ULID is generated by another system, use the ``fromString()`` method to -create an object and make use of the utilities available for Symfony ULIDs:: +If your ULID value is already generated in another format, use any of the +following methods to create a ``Ulid`` object from it:: + + // all the following examples would generate the same Ulid object + $ulid = Ulid::fromString('01E439TP9XJZ9RPFH3T1PYBCR8'); + $ulid = Ulid::fromBinary("\x01\x71\x06\x9d\x59\x3d\x97\xd3\x8b\x3e\x23\xd0\x6d\xe5\xb3\x08"); + $ulid = Ulid::fromBase32('01E439TP9XJZ9RPFH3T1PYBCR8'); + $ulid = Ulid::fromBase58('1BKocMc5BnrVcuq2ti4Eqm'); + $ulid = Ulid::fromRfc4122('0171069d-593d-97d3-8b3e-23d06de5b308'); + +.. versionadded:: 5.3 - // this value is generated somewhere else (can also be in binary format) - $ulidValue = '01E439TP9XJZ9RPFH3T1PYBCR8'; - $ulid = Ulid::fromString($ulidValue); + The ``fromBinary()``, ``fromBase32()``, ``fromBase58()`` and ``fromRfc4122()`` + methods were introduced in Symfony 5.3. Converting ULIDs ~~~~~~~~~~~~~~~~ @@ -252,7 +268,7 @@ Use these methods to transform the ULID object into different bases:: $ulid = Ulid::fromString('01E439TP9XJZ9RPFH3T1PYBCR8'); - $ulid->toBinary(); // string(16) "..." (binary contents can't be printed) + $ulid->toBinary(); // string(16) "\x01\x71\x06\x9d\x59\x3d\x97\xd3\x8b\x3e\x23\xd0\x6d\xe5\xb3\x08" $ulid->toBase32(); // string(26) "01E439TP9XJZ9RPFH3T1PYBCR8" $ulid->toBase58(); // string(22) "1BKocMc5BnrVcuq2ti4Eqm" $ulid->toRfc4122(); // string(36) "0171069d-593d-97d3-8b3e-23d06de5b308" From 8daccd39555d4db035625b0c4e25f55059efb929 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Apr 2021 16:52:54 +0200 Subject: [PATCH 0123/5386] [HttpFoundation] Document the unix_socket and charset options for MySQL PdoSessionHandler --- session/database.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/session/database.rst b/session/database.rst index 01c663911e1..dffed5562e7 100644 --- a/session/database.rst +++ b/session/database.rst @@ -234,6 +234,16 @@ first register a new handler service with your database credentials: ; }; +.. tip:: + + When using MySQL as the database, the DSN defined in ``DATABASE_URL`` can + contain the ``charset`` and ``unix_socket`` options as query string parameters. + + .. versionadded:: 5.3 + + The support for ``charset`` and ``unix_socket`` options was introduced + in Symfony 5.3. + Next, use the :ref:`handler_id ` configuration option to tell Symfony to use this service as the session handler: From 12b0cfc4d6f9e3d47fa4a7046f4b8941107954ff Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Apr 2021 11:13:06 +0200 Subject: [PATCH 0124/5386] [DomCrawler] Clarify the ways to add contents --- components/dom_crawler.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 1363d977a3a..b1dda3d42f7 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -292,7 +292,9 @@ context of the crawler:: Adding the Content ~~~~~~~~~~~~~~~~~~ -The crawler supports multiple ways of adding the content:: +The crawler supports multiple ways of adding the content, but they are mutually +exclusive, so you can only use one of them to add content (e.g. if you pass the +content to the ``Crawler`` constructor, you can't call ``addContent()`` later):: $crawler = new Crawler(''); From 0354465e71fd3b72c649f68d2a3f40b8ad0bc162 Mon Sep 17 00:00:00 2001 From: Linus Karlsson Date: Mon, 12 Apr 2021 10:59:28 +0200 Subject: [PATCH 0125/5386] Update table in lock component --- components/lock.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lock.rst b/components/lock.rst index 4200adcd817..dfb3962464c 100644 --- a/components/lock.rst +++ b/components/lock.rst @@ -357,7 +357,7 @@ Store Scope Blocking Expiring Sharing :ref:`MemcachedStore ` remote no yes no :ref:`MongoDbStore ` remote no yes no :ref:`PdoStore ` remote no yes no -:ref:`PostgreSqlStore ` remote yes yes yes +:ref:`PostgreSqlStore ` remote yes no yes :ref:`RedisStore ` remote no yes yes :ref:`SemaphoreStore ` local yes no no :ref:`ZookeeperStore ` remote no no no From a7cf4b344ddf31729e6b310848317d4cd8d15685 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 12 Apr 2021 13:20:30 +0200 Subject: [PATCH 0126/5386] Updated link to v5.2 version --- configuration/dot-env-changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/dot-env-changes.rst b/configuration/dot-env-changes.rst index bed01ea766a..6679600e908 100644 --- a/configuration/dot-env-changes.rst +++ b/configuration/dot-env-changes.rst @@ -85,7 +85,7 @@ changes can be made to any Symfony 3.4 or higher app: and update your `phpunit.xml.dist file`_ so it loads the ``tests/bootstrap.php`` file. -.. _`public/index.php`: https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/5.1/public/index.php +.. _`public/index.php`: https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/5.2/public/index.php .. _`bin/console`: https://github.com/symfony/recipes/blob/master/symfony/console/5.1/bin/console .. _`comment on the top of .env`: https://github.com/symfony/recipes/blob/master/symfony/flex/1.0/.env .. _`create a new .env.test`: https://github.com/symfony/recipes/blob/master/symfony/phpunit-bridge/3.3/.env.test From f0853efdf4a695e53e924aada965b5879b5c72c8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 12 Apr 2021 13:43:33 +0200 Subject: [PATCH 0127/5386] Fixed RST syntax issue --- security/login_link.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/login_link.rst b/security/login_link.rst index d3c7b0e4c23..456cfc706c6 100644 --- a/security/login_link.rst +++ b/security/login_link.rst @@ -661,7 +661,7 @@ Customizing the Success Handler Sometimes, the default success handling does not fit your use-case (e.g. when you need to generate and return an API key). To customize how the success handler behaves, create your own -:class:`Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface`:: +:class:`Symfony\\Component\\Security\\Http\\Authentication\\AuthenticationSuccessHandlerInterface`:: // src/Security/Authentication/AuthenticationSuccessHandler.php namespace App\Security\Authentication; From d39b47767c9f8085e3e199f8d88f87d104fe7ad0 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 7 Apr 2021 15:18:01 +0200 Subject: [PATCH 0128/5386] Docs for Slack options field() method Closes #13398 --- _images/notifier/slack/field-method.png | Bin 0 -> 17302 bytes notifier/chatters.rst | 38 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 _images/notifier/slack/field-method.png diff --git a/_images/notifier/slack/field-method.png b/_images/notifier/slack/field-method.png new file mode 100644 index 0000000000000000000000000000000000000000..d77a60e6a2e920910686cfd06702d68360050bf6 G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J?6!(tpSHIr7spH5r#pZV^LRnTr}Vbj1!YMSnE;}&#aHTPV2M%;tP4^ zJ1PTU42NZ3dCq6xoq;fZ&f4iqJw4nyWylV#VsqIWsyA8|$|9n}A2_@z9FFs6nS%s`Ulf%XUB~Nw7bk4X-18a+@K3Z;#8$Gm(wrD8$^; R>dW5(N{GpdmI~|o{SO+qaeM#( literal 0 HcmV?d00001 diff --git a/notifier/chatters.rst b/notifier/chatters.rst index da11c8858b9..318ed8c74d7 100644 --- a/notifier/chatters.rst +++ b/notifier/chatters.rst @@ -98,6 +98,44 @@ to add some interactive options called `Block elements`_:: $chatter->send($chatMessage); +Adding Fields and Values to a Slack Message +------------------------------------------- + +To add fields and values to your message you can use the +:method:`SlackSectionBlock::field() ` method:: + + use Symfony\Component\Notifier\Bridge\Slack\Block\SlackDividerBlock; + use Symfony\Component\Notifier\Bridge\Slack\Block\SlackSectionBlock; + use Symfony\Component\Notifier\Bridge\Slack\SlackOptions; + use Symfony\Component\Notifier\Message\ChatMessage; + + $chatMessage = new ChatMessage('Symfony Feature'); + + $options = (new SlackOptions()) + ->block((new SlackSectionBlock())->text('My message')) + ->block(new SlackDividerBlock()) + ->block( + (new SlackSectionBlock()) + ->field('*Max Rating*') + ->field('5.0') + ->field('*Min Rating*') + ->field('1.0') + ); + + // Add the custom options to the chat message and send the message + $chatMessage->options($options); + + $chatter->send($chatMessage); + +The result will be something like: + +.. image:: /_images/notifier/slack/field-method.png + :align: center + +.. versionadded:: 5.1 + + The `field()` method was introduced in Symfony 5.1. + Adding Interactions to a Discord Message ---------------------------------------- From 6b105893cfe25b8b34cddd504a230d3c38e5220a Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Mon, 12 Apr 2021 23:21:43 +0200 Subject: [PATCH 0129/5386] [Symfony CLI] Document about `APP_ENV=test` behavior Running the Symfony CLI with `APP_ENV=test` has an interesting but undocumented behaviour, it updates `DATABASE_*` environment variables for a test environment. --- setup/symfony_server.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup/symfony_server.rst b/setup/symfony_server.rst index f0723c20ea1..580af42bfba 100644 --- a/setup/symfony_server.rst +++ b/setup/symfony_server.rst @@ -322,6 +322,22 @@ prefixed with ``DB_``, but as the ``com.symfony.server.service-prefix`` is set to ``DATABASE``, the web server creates environment variables starting with ``DATABASE_`` instead as expected by the default Symfony configuration. +You don't need to create two containers for a main database and a test database. +Using `APP_ENV=test symfony` will automatically adjust `DATABASE_*` environment variables +for a test environment. + +.. code-block:: terminal + + $ symfony var:export --multiline + export DATABASE_DATABASE=app + export DATABASE_NAME=app + export DATABASE_URL=postgres://app:app@127.0.0.1:49160/app?sslmode=disable&charset=utf8 + + $ APP_ENV=test symfony var:export --multiline + export DATABASE_DATABASE=app_test + export DATABASE_NAME=app_test + export DATABASE_URL=postgres://app:app@127.0.0.1:49160/app_test?sslmode=disable&charset=utf8 + Here is the list of supported services with their ports and default Symfony prefixes: From 2e77005d76dff81a99055f7eca8286bec44f850e Mon Sep 17 00:00:00 2001 From: Jason Aller Date: Thu, 8 Apr 2021 13:29:05 -0700 Subject: [PATCH 0130/5386] [Ldap] Update ldap.rst --- components/ldap.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/ldap.rst b/components/ldap.rst index d7cb6ed17cd..60c4629fec9 100644 --- a/components/ldap.rst +++ b/components/ldap.rst @@ -115,6 +115,11 @@ to the ``LDAP_SCOPE_BASE`` scope of :phpfunction:`ldap_read`) and ``SCOPE_ONE`` $query = $ldap->query('dc=symfony,dc=com', '...', ['scope' => QueryInterface::SCOPE_ONE]); +To retrieve only specific attributes you can specify which attributes you want returned using +the ``filter`` option:: + + $query = $ldap->query('dc=symfony,dc=com', '...', ['filter' => ['cn, mail']); + Creating or Updating Entries ---------------------------- From 4586d288f27709970e2c60f6c51ccd66d5e4667e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 13 Apr 2021 08:57:23 +0200 Subject: [PATCH 0131/5386] Minor reword --- components/ldap.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/ldap.rst b/components/ldap.rst index 60c4629fec9..5b16a3ffb97 100644 --- a/components/ldap.rst +++ b/components/ldap.rst @@ -115,8 +115,7 @@ to the ``LDAP_SCOPE_BASE`` scope of :phpfunction:`ldap_read`) and ``SCOPE_ONE`` $query = $ldap->query('dc=symfony,dc=com', '...', ['scope' => QueryInterface::SCOPE_ONE]); -To retrieve only specific attributes you can specify which attributes you want returned using -the ``filter`` option:: +Use the ``filter`` option to only retrieve some specific attributes: $query = $ldap->query('dc=symfony,dc=com', '...', ['filter' => ['cn, mail']); From 5529b12eb11e8557c6f94fc663bee2beb42c0490 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 13 Apr 2021 12:00:38 +0200 Subject: [PATCH 0132/5386] Minor tweak --- setup/symfony_server.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/symfony_server.rst b/setup/symfony_server.rst index 580af42bfba..7420a822ab6 100644 --- a/setup/symfony_server.rst +++ b/setup/symfony_server.rst @@ -322,9 +322,9 @@ prefixed with ``DB_``, but as the ``com.symfony.server.service-prefix`` is set to ``DATABASE``, the web server creates environment variables starting with ``DATABASE_`` instead as expected by the default Symfony configuration. -You don't need to create two containers for a main database and a test database. -Using `APP_ENV=test symfony` will automatically adjust `DATABASE_*` environment variables -for a test environment. +You don't need to create two containers for the main database and the test +database. Using ``APP_ENV=test symfony`` will automatically adjust +``DATABASE_*`` environment variables for the ``test`` environment: .. code-block:: terminal From 3780af231b78da570d6d1bf757b9206c29e1cc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl?= <50833583+Mis0u@users.noreply.github.com> Date: Tue, 13 Apr 2021 14:08:16 +0200 Subject: [PATCH 0133/5386] Update login_link.rst I propose this change to manage the case of the link is invalid --- security/login_link.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/security/login_link.rst b/security/login_link.rst index 456cfc706c6..f7f5e36751e 100644 --- a/security/login_link.rst +++ b/security/login_link.rst @@ -739,3 +739,5 @@ Then, configure this service ID as the ``success_handler``: ], ], ]); + +If you want to manage the failure for example the link is expires, use 'failure_handler' and implements "AuthenticationFailureHandlerInterface" instand of "AuthenticationSuccessHandlerInterface" From b7340c7e7633177d37230bda2923bf3b1cb1d01d Mon Sep 17 00:00:00 2001 From: Stefan Graupner Date: Sun, 14 Mar 2021 15:38:24 +0100 Subject: [PATCH 0134/5386] [Workflow] Add info about MermaidDumper [Workflow] rst syntax fixes --- .../components/workflow/blogpost_mermaid.png | Bin 0 -> 24123 bytes workflow/dumping-workflows.rst | 20 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 _images/components/workflow/blogpost_mermaid.png diff --git a/_images/components/workflow/blogpost_mermaid.png b/_images/components/workflow/blogpost_mermaid.png new file mode 100644 index 0000000000000000000000000000000000000000..b0ffbc984c9dc40ef086aa3cc2f0029ca974a284 GIT binary patch literal 24123 zcmZ^LbyU>f7cF3*v>;s~B_JT(prmwnDc#*E(o#w{0@B?vbV_%3cXti%j^E#V|2-Fr zHH**8XYS|Td(Pcw?|lrGlMzEjB0z$JgF_YnEUW+rhoBB#U%z+`elJmB+bOG%?!R?2u@F}GI{Q~I_vXQ##MmJ(n@t$sMUW2|MiQedvZmifSBrDI* z)Ji>8&rRD_S7E*d^_j>kVW;?K@n5~XZL*}4Vtu~e@RCN5?Ai=oc?^CSXxMUZ+PZTr z)hJT&!w`Hy<|oZH3xOj8uY(dl3&z6!B>e2>PfFNDd3Xwgm#|Apa4*$i@5R9W`2TrJ zhQfGt0$0o>!$;WLCUl+Z6Z*$JP!f#J)s4<)aLyBOz>ClsfA7f?C&4sB(Y3pRx^L3kfhyL*nf*-Z`UEI3M%-;`>&xgK})hd%RHwGt07bS*D7#eiRDH`o$`$EQ*d!@jUL z%s<}P7GaKzS^jSp3$^s&Aye5lTwR|7y>zah?b(#B(c90M-gFQTZQhSa)uWzfD64YZ z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9_mR%^PmxLvpnYR@7jVQ{Ew~`CX(3843_=cV{p7LZWCR$}$2( z1uQ1STe<{w6_^Ah#n$UnV7|AV8a!Go$bPC&Sib93tT#Q!<4mxw+40J1CBoi2jDeuZ z?Eq!>-<}66E^a(}7N^D^T5l>MJ|TxU;Im`I6L9 z=AF7XXZys>s|~|nO}ZyHXzf<`nwN6Jm;QpLE*^gVNEI~0c{Vo9wFxW&KZ}c-niMOY zf2eC}Qu6ZhBIT7v5*lzBVS-oIwaxgFml%>2>`I%aSnro2>vXAMTHB}@5xcv1HmB>H zu>TgMFP?4STlEbL5Cs%&sX(UudaxZEyrEFs+@au&qGM|Mx~fV7+_)^Z7I2?yjBRC} zT`bdkGQ(xQ>?Lks-ykJ%(FFEpe&d->#qj(%csIQLi`E};m}k6)mmlPu}>7ZhTUb3d-&<|YJ0kw|iK zG9($HG#uR!br;8~iZZGrm%F)^!jn&$M|o2+g$knNI(l0J~wDc8iR24`6 z1y*yxb|IAkanEWo^z42WN>>2AoM&2)P_Fa(YnwBzl!OG8)%&uoRcv-GJ9*&_bo0$TiC zYvglrhh^Y}8WFms1wC4prmxrLHtRuw{aHs?J~2-ILV z{0ZtDWiA>Fj9SbKGUe>-$LaBrf84CDer{P?`q{PgX>pA67Nwhkv|a(!tl;y?1r((k zBfFLiBX2aweTvyv)8qaAUQ>1w=h>YXbPZ-De(~T!r|$oTG96j?fziX&Pu#FCd}H}j zb6zbydww0drd>z%fSF{mJtRJ*V{y1I<{!0`R%4-mw}y6GC)$!*>|?Y?E0tAN%KEPl z@ECQGvot!5D#2oL Date: Tue, 13 Apr 2021 19:10:06 +0200 Subject: [PATCH 0135/5386] Fix typo in handler success customization part. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backslashes were missing. Reading was difficult, especially at the end of that very complete page 😅 . --- security/login_link.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/security/login_link.rst b/security/login_link.rst index 456cfc706c6..34705d28983 100644 --- a/security/login_link.rst +++ b/security/login_link.rst @@ -660,8 +660,10 @@ Customizing the Success Handler Sometimes, the default success handling does not fit your use-case (e.g. when you need to generate and return an API key). To customize how the -success handler behaves, create your own -:class:`Symfony\\Component\\Security\\Http\\Authentication\\AuthenticationSuccessHandlerInterface`:: +success handler behaves, create your own that must implement +:class:`Symfony\\Component\\Security\\Http\\Authentication\\AuthenticationSuccessHandlerInterface`. + +.. code-block:: php // src/Security/Authentication/AuthenticationSuccessHandler.php namespace App\Security\Authentication; From 369e959d0edc411a1d006781e25da4c732f7245d Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 13 Apr 2021 21:09:00 +0200 Subject: [PATCH 0136/5386] Fixing typo "by" was misssing. --- forms.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/forms.rst b/forms.rst index 17cd593d416..6f244fd7d1c 100644 --- a/forms.rst +++ b/forms.rst @@ -695,8 +695,7 @@ Set the ``label`` option on fields to define their labels explicitly:: .. tip:: By default, ``