Skip to content

[Finder] Add case insensitive sort #16735

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 152 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
b7438ff
Update setup.rst ( version 6.2 )
BahmanMD May 31, 2022
a205fda
minor #16832 Update setup.rst ( version 6.2 ) (BahmanMD, OskarStark)
OskarStark Jun 2, 2022
e62f3d1
Merge branch '6.1' into 6.2
OskarStark Jun 2, 2022
e2bd729
Merge branch '6.1' into 6.2
javiereguiluz Jun 2, 2022
58c1978
Merge branch '6.1' into 6.2
javiereguiluz Jun 6, 2022
c7369d5
[Security][SecurityBundle] Move the Security helper to SecurityBundle
javiereguiluz Jun 6, 2022
8f5c220
Merge branch '6.1' into 6.2
javiereguiluz Jun 6, 2022
627a3c2
Merge branch '6.1' into 6.2
javiereguiluz Jun 6, 2022
f47401b
minor #16848 [Security] Move the Security helper to SecurityBundle (j…
javiereguiluz Jun 6, 2022
eaa15f6
Merge branch '6.1' into 6.2
javiereguiluz Jun 6, 2022
f444462
Merge branch '6.1' into 6.2
OskarStark Jun 7, 2022
ace2802
Merge branch '6.1' into 6.2
javiereguiluz Jun 9, 2022
d122004
Merge branch '6.1' into 6.2
javiereguiluz Jun 10, 2022
da8274a
Merge branch '6.1' into 6.2
javiereguiluz Jun 10, 2022
0e14ecf
[Security] Enforce maximum username length
javiereguiluz Jun 9, 2022
55fe8c9
minor #16858 [Security] Enforce maximum username length (javiereguiluz)
javiereguiluz Jun 10, 2022
398f589
Merge branch '6.1' into 6.2
javiereguiluz Jun 10, 2022
e480a3f
Merge branch '6.1' into 6.2
javiereguiluz Jun 13, 2022
46aa5df
Merge branch '6.1' into 6.2
javiereguiluz Jun 13, 2022
fe8449d
Merge branch '6.1' into 6.2
javiereguiluz Jun 13, 2022
f756a93
Merge branch '6.1' into 6.2
javiereguiluz Jun 14, 2022
1ccf93a
Merge branch '6.1' into 6.2
javiereguiluz Jun 16, 2022
264d3a2
Merge branch '6.1' into 6.2
javiereguiluz Jun 16, 2022
5f60dd0
Merge branch '6.1' into 6.2
javiereguiluz Jun 16, 2022
9e9cb26
Merge branch '6.1' into 6.2
javiereguiluz Jun 16, 2022
cb0b2c5
Merge branch '6.1' into 6.2
javiereguiluz Jun 17, 2022
5373de1
Minor update
javiereguiluz Jun 17, 2022
a754d3f
Merge branch '6.1' into 6.2
javiereguiluz Jun 17, 2022
bf444ac
Merge branch '6.1' into 6.2
javiereguiluz Jun 17, 2022
d66f33f
Merge branch '6.1' into 6.2
javiereguiluz Jun 18, 2022
139fb13
Merge branch '6.1' into 6.2
javiereguiluz Jun 18, 2022
06394b3
Merge branch '6.1' into 6.2
javiereguiluz Jun 18, 2022
9d90705
[Mailer] Rename OhMySMTP to MailPace
Holicz Jun 19, 2022
655d0ae
Merge branch '6.1' into 6.2
javiereguiluz Jun 20, 2022
ec19f5e
Merge branch '6.1' into 6.2
javiereguiluz Jun 20, 2022
3ffe898
Merge branch '6.1' into 6.2
javiereguiluz Jun 23, 2022
80a0506
[Notifier] [SMSFactor] add docs
Gwemox Jun 20, 2022
645144d
Merge branch '6.1' into 6.2
OskarStark Jun 24, 2022
dd02a7c
Merge branch '6.1' into 6.2
javiereguiluz Jun 27, 2022
1917229
Merge branch '6.1' into 6.2
javiereguiluz Jun 28, 2022
fa3c6df
minor #16896 [Mailer] Rename OhMySMTP to MailPace (Holicz)
javiereguiluz Jun 28, 2022
3d3f08f
Add a versionadded directive
javiereguiluz Jun 28, 2022
908aa00
Merge branch '6.1' into 6.2
javiereguiluz Jun 28, 2022
0a20729
Merge branch '6.1' into 6.2
javiereguiluz Jun 28, 2022
af10fcc
Merge branch '6.1' into 6.2
javiereguiluz Jul 4, 2022
0f334b9
Merge branch '6.1' into 6.2
javiereguiluz Jul 4, 2022
9eda4b9
minor #16901 [Notifier] [SMSFactor] add docs (Gwemox)
javiereguiluz Jul 4, 2022
f17fe1b
Minor tweak
javiereguiluz Jul 4, 2022
e94b291
Merge branch '6.1' into 6.2
javiereguiluz Jul 4, 2022
7a6eafb
Merge branch '6.1' into 6.2
javiereguiluz Jul 4, 2022
c3e4444
Merge branch '6.1' into 6.2
javiereguiluz Jul 4, 2022
32201ba
Merge branch '6.1' into 6.2
javiereguiluz Jul 4, 2022
6857913
[Mailer] Deprecate the "loose" validation option
javiereguiluz Jul 4, 2022
eaf4a35
minor #16939 [Mailer] Deprecate the "loose" validation option (javier…
javiereguiluz Jul 6, 2022
91a70aa
Merge branch '6.1' into 6.2
javiereguiluz Jul 6, 2022
4f43ee8
Merge branch '6.1' into 6.2
javiereguiluz Jul 6, 2022
05a80d2
Add `enum` env var processor documentation
alexandre-daubois Jul 7, 2022
a3eda50
[Yaml] Add support for !php/enum *->value syntax
alexandre-daubois Jul 7, 2022
a77adcb
Merge branch '6.1' into 6.2
javiereguiluz Jul 8, 2022
9afd9fd
minor #16947 [Yaml] Add support for !php/enum *->value syntax (alexan…
javiereguiluz Jul 8, 2022
67e021a
Minor reword
javiereguiluz Jul 8, 2022
7991e5a
Merge branch '6.1' into 6.2
javiereguiluz Jul 8, 2022
971073b
minor #16945 [DependencyInjection] Add `enum` env var processor docum…
javiereguiluz Jul 8, 2022
3a3c990
Add the versionadded directive
javiereguiluz Jul 8, 2022
d2c631b
Merge branch '6.1' into 6.2
javiereguiluz Jul 8, 2022
c123cc9
Merge branch '6.1' into 6.2
javiereguiluz Jul 8, 2022
8896d7a
Merge branch '6.1' into 6.2
javiereguiluz Jul 8, 2022
52f80e9
[DependencyInjection] Add shuffle env var processor documentation
ostrolucky Jul 10, 2022
33d4a86
[Console] Add Multiselect to choice()
alexandre-daubois Jul 11, 2022
1719154
minor #16962 [DependencyInjection] Add shuffle env var processor docu…
javiereguiluz Jul 11, 2022
0d99409
Minor tweaks
javiereguiluz Jul 11, 2022
d2c7597
Merge branch '6.1' into 6.2
javiereguiluz Jul 11, 2022
b6a822b
Merge branch '6.1' into 6.2
javiereguiluz Jul 11, 2022
fcfef73
Merge branch '6.1' into 6.2
javiereguiluz Jul 11, 2022
5752165
Merge branch '6.1' into 6.2
javiereguiluz Jul 11, 2022
fb6d096
Add Zendesk notifier in the chat channel section
mdoutreluingne Jul 11, 2022
1d992ef
Merge branch '6.1' into 6.2
javiereguiluz Jul 13, 2022
7066efe
minor #16967 [Notifier] Add Zendesk Notifier Bridge (mdoutreluingne)
javiereguiluz Jul 13, 2022
0534011
minor #16965 [Console] Add Multiselect to choice() (alexandre-daubois)
javiereguiluz Jul 13, 2022
43f692e
Add the versionadded directive
javiereguiluz Jul 13, 2022
5c19417
Minor
OskarStark Jul 13, 2022
b4bcac8
Merge branch '6.1' into 6.2
javiereguiluz Jul 18, 2022
91147f8
Merge remote-tracking branch 'upstream/6.2' into 6.2
javiereguiluz Jul 18, 2022
08e8319
[Notifier] Add ContactEveryone Doc
zairigimad Jul 15, 2022
4c04fd0
minor #16984 [Notifier] Add ContactEveryone Doc (zairigimad)
javiereguiluz Jul 18, 2022
b10cbc8
Minor tweaks
javiereguiluz Jul 18, 2022
5970069
Fix RST table
javiereguiluz Jul 18, 2022
a6b283b
[DependencyInjection] Use lazy-loading ghost object proxies out of th…
javiereguiluz Jul 18, 2022
f14ec5d
[Mailer] Add Infobip bridge
B-Galati Apr 29, 2022
1894141
Add #[Cache()] attribute
javiereguiluz Jul 18, 2022
2c57a5b
[HttpKernel] Document the catch_all_throwables option
javiereguiluz Jul 18, 2022
f6ebf75
Merge branch '6.1' into 6.2
javiereguiluz Jul 19, 2022
dd22258
minor #17001 [HttpKernel] Document the catch_all_throwables option (j…
javiereguiluz Jul 19, 2022
bf22899
Merge branch '6.1' into 6.2
javiereguiluz Jul 19, 2022
facd25d
[Security] Mention the SensitiveParameter attribute
javiereguiluz Jul 18, 2022
e446184
minor #16997 [Security] Mention the SensitiveParameter attribute (jav…
javiereguiluz Jul 19, 2022
3abdbc3
[Security] Document the getFirewallConfig() method
javiereguiluz Jul 18, 2022
f8d5eae
minor #17000 [Security] Document the getFirewallConfig() method (javi…
javiereguiluz Jul 19, 2022
112e6bb
Add #[Template()] attribute
javiereguiluz Jul 18, 2022
3e1a5e2
minor #16996 Add #[Template()] attribute (javiereguiluz)
javiereguiluz Jul 19, 2022
6b0c6f2
[Debug] Add `resolve-env` option documentation of `debug:config` command
alexandre-daubois Jul 21, 2022
8c0fdcb
Added toHex method to AbstractUid class
mdoutreluingne Jul 21, 2022
0b643c1
Merge branch '6.1' into 6.2
javiereguiluz Jul 21, 2022
d562f24
minor #17032 [Uid] Added toHex method to AbstractUid class (mdoutrelu…
javiereguiluz Jul 21, 2022
2a5c011
Add the versionadded directive
javiereguiluz Jul 21, 2022
cf50198
minor #16998 [HttpKernel] Add #[Cache()] attribute (javiereguiluz)
javiereguiluz Jul 21, 2022
0ca9832
Update Expression constraint with "negate" option
Jun 6, 2022
0ef1875
feature #16852 [Validator] Update Expression constraint with "negate"…
OskarStark Jul 22, 2022
3bed40f
Fix: Backticks
OskarStark Jul 22, 2022
7b2edfc
Fix: Move versionadded
OskarStark Jul 22, 2022
ab8658c
minor #17029 [Debug] Add `resolve-env` option documentation of `debug…
javiereguiluz Jul 22, 2022
edd706f
Reword
javiereguiluz Jul 22, 2022
b79d456
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
2dab443
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
4bdcd53
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
d4fb437
minor #16995 [DependencyInjection] Use lazy-loading ghost object prox…
javiereguiluz Jul 22, 2022
0252b2e
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
ad76e3c
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
12ccfcc
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
b2193d8
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
cb0bf11
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
a207347
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
77804f9
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
e6156e3
[Finder] Mention the new sortByExtension() and sortBySize() methods
javiereguiluz Jul 22, 2022
d10df4f
[Dotenv] Document the debug command filter
javiereguiluz Jul 22, 2022
28cae48
[Form] Mention that choice labels support TranslatableInterface objects
javiereguiluz Jul 22, 2022
66cee25
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
85e58be
[Security] Document the enable_csrf logout option
javiereguiluz Jul 22, 2022
eff62e1
[Security] Reorder the location of the delete_cookies option
javiereguiluz Jul 22, 2022
8ab7c3d
Merge branch '6.1' into 6.2
javiereguiluz Jul 22, 2022
733a8aa
minor #17040 [Finder] Mention the new sortByExtension() and sortBySiz…
javiereguiluz Jul 22, 2022
e03b442
minor #16760 [Mailer] Add Infobip bridge (B-Galati)
javiereguiluz Jul 23, 2022
36f1d83
[Validator] Document the match option of Choice constraint
javiereguiluz Jul 22, 2022
20eb6c7
minor #17043 [Validator] Document the match option of Choice constrai…
javiereguiluz Jul 23, 2022
de9e8e2
minor #17041 [Dotenv] Document the debug command filter (javiereguiluz)
javiereguiluz Jul 23, 2022
959bc5e
[Form] Allow TranslatableInterface to the FormType help option
alamirault Jul 24, 2022
0854561
Merge branch '6.1' into 6.2
javiereguiluz Jul 26, 2022
3f84ac5
minor #17044 [Form] Mention that choice labels support TranslatableIn…
javiereguiluz Jul 26, 2022
7d83ece
minor #17045 [Security] Document the enable_csrf logout option (javie…
javiereguiluz Jul 26, 2022
0b025e9
minor #17055 [Form] Allow TranslatableInterface to the FormType help …
javiereguiluz Jul 26, 2022
d93617a
Add the versionadded directive
javiereguiluz Jul 26, 2022
4fbbc16
Add more information about sending email async
fabpot Jul 27, 2022
b15763c
minor #17065 [Mailer] Add more information about sending email async …
javiereguiluz Jul 27, 2022
aa8a221
Merge branch '6.1' into 6.2
javiereguiluz Jul 27, 2022
84512fe
Merge branch '6.1' into 6.2
javiereguiluz Jul 27, 2022
79276ae
Merge branch '6.1' into 6.2
javiereguiluz Jul 29, 2022
148276f
Merge branch '6.1' into 6.2
javiereguiluz Jul 29, 2022
b7986c2
Merge branch '6.1' into 6.2
javiereguiluz Jul 29, 2022
94ed3e9
Merge branch '6.1' into 6.2
javiereguiluz Jul 29, 2022
3a68a52
Merge branch '6.1' into 6.2
javiereguiluz Jul 29, 2022
bd72b38
Readd the docs about Null Coalescing Operator
javiereguiluz Jul 29, 2022
49cbb08
Merge branch '6.1' into 6.2
javiereguiluz Jul 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions _build/maintainer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ contributes again, it's OK to mention some of the minor issues to educate them.

$ gh merge 11059

Working on symfony/symfony-docs (branch 6.1)
Working on symfony/symfony-docs (branch 6.2)
Merging Pull Request 11059: dmaicher/patch-3

...

# This is important!! Say NO to push the changes now
Push the changes now? (Y/n) n
Now, push with: git push gh "6.1" refs/notes/github-comments
Now, push with: git push gh "6.2" refs/notes/github-comments

# Now, open your editor and make the needed changes ...

$ git commit -a
# Use "Minor reword", "Minor tweak", etc. as the commit message

# now run the 'push' command shown above by 'gh' (it's different each time)
$ git push gh "6.1" refs/notes/github-comments
$ git push gh "6.2" refs/notes/github-comments

Merging Pull Requests
---------------------
Expand Down
8 changes: 0 additions & 8 deletions best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,6 @@ configuration. You don't need to browse several files created with different
formats (YAML, XML, PHP): all the configuration is just where you need it and
it only uses one format.

Don't Use Annotations to Configure the Controller Template
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``@Template`` annotation is useful, but also involves some *magic*.
Moreover, most of the time ``@Template`` is used without any parameters, which
makes it more difficult to know which template is being rendered. It also hides
the fact that a controller should always return a ``Response`` object.

Use Dependency Injection to Get Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
17 changes: 17 additions & 0 deletions components/expression_language/syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,23 @@ Ternary Operators
* ``foo ?: 'no'`` (equal to ``foo ? foo : 'no'``)
* ``foo ? 'yes'`` (equal to ``foo ? 'yes' : ''``)

Null Coalescing Operator
~~~~~~~~~~~~~~~~~~~~~~~~

This is the same as the PHP `null-coalescing operator`_, which combines
the ternary operator and ``isset()``. It returns the left hand-side if it exists
and it's not ``null``; otherwise it returns the right hand-side. Note that you
can chain multiple coalescing operators.

* ``foo ?? 'no'``
* ``foo.baz ?? 'no'``
* ``foo[3] ?? 'no'``
* ``foo.baz ?? foo['baz'] ?? 'no'``

.. versionadded:: 6.2

The null-coalescing operator was introduced in Symfony 6.2.

Built-in Objects and Variables
------------------------------

Expand Down
9 changes: 7 additions & 2 deletions components/finder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,17 @@ instance. The file is excluded from the result set if the Closure returns
Sorting Results
---------------

Sort the results by name or by type (directories first, then files)::
Sort the results by name, extension, size or type (directories first, then files)::

$finder->sortByName();

$finder->sortByExtension();
$finder->sortBySize();
$finder->sortByType();

.. versionadded:: 6.2

The ``sortByExtension()`` and ``sortBySize()`` methods were introduced in Symfony 6.2.

.. tip::

By default, the ``sortByName()`` method uses the :phpfunction:`strcmp` PHP
Expand Down
13 changes: 6 additions & 7 deletions components/http_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,12 @@ return a ``Response``.

.. sidebar:: ``kernel.view`` in the Symfony Framework

There is no default listener inside the Symfony Framework for the ``kernel.view``
event. However, `SensioFrameworkExtraBundle`_ *does* add a listener to this
event. If your controller returns an array, and you place the `@Template`_
annotation above the controller, then this listener renders a template,
passes the array you returned from your controller to that template, and
creates a ``Response`` containing the returned content from that template.
There is a default listener inside the Symfony Framework for the ``kernel.view``
event. If your controller action returns an array, and you apply the
:ref:`#[Template()] attribute <templates-template-attribute>` to that
controller action, then this listener renders a template, passes the array
you returned from your controller to that template, and creates a ``Response``
containing the returned content from that template.

Additionally, a popular community bundle `FOSRestBundle`_ implements
a listener on this event which aims to give you a robust view layer
Expand Down Expand Up @@ -751,5 +751,4 @@ Learn more
.. _`PHP FPM`: https://www.php.net/manual/en/install.fpm.php
.. _`SensioFrameworkExtraBundle`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html
.. _`@ParamConverter`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
.. _`@Template`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/view.html
.. _variadic: https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list
10 changes: 10 additions & 0 deletions components/uid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ Use these methods to transform the UUID object into different bases::
$uuid->toBase32(); // string(26) "6SWYGR8QAV27NACAHMK5RG0RPG"
$uuid->toBase58(); // string(22) "TuetYWNHhmuSQ3xPoVLv9M"
$uuid->toRfc4122(); // string(36) "d9e7a184-5d5b-11ea-a62a-3499710062d0"
$uuid->toHex(); // string(34) "0xd9e7a1845d5b11eaa62a3499710062d0"

.. versionadded:: 6.2

The ``toHex()`` method was introduced in Symfony 6.2.

Working with UUIDs
~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -258,6 +263,11 @@ Use these methods to transform the ULID object into different bases::
$ulid->toBase32(); // string(26) "01E439TP9XJZ9RPFH3T1PYBCR8"
$ulid->toBase58(); // string(22) "1BKocMc5BnrVcuq2ti4Eqm"
$ulid->toRfc4122(); // string(36) "0171069d-593d-97d3-8b3e-23d06de5b308"
$ulid->toHex(); // string(34) "0x0171069d593d97d38b3e23d06de5b308"

.. versionadded:: 6.2

The ``toHex()`` method was introduced in Symfony 6.2.

Working with ULIDs
~~~~~~~~~~~~~~~~~~
Expand Down
30 changes: 30 additions & 0 deletions components/yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,35 @@ syntax to parse them as proper PHP constants::
$parameters = Yaml::parse($yaml, Yaml::PARSE_CONSTANT);
// $parameters = ['foo' => 'PHP_INT_SIZE', 'bar' => 8];

Parsing PHP Enumerations
~~~~~~~~~~~~~~~~~~~~~~~~

The YAML parser supports `PHP enumerations`_, both unit and backed enums.
By default, they are parsed as regular strings. Use the ``PARSE_CONSTANT`` flag
and the special ``!php/enum`` syntax to parse them as proper PHP enums::

enum FooEnum: string
{
case Foo = 'foo';
case Bar = 'bar';
}

// ...

$yaml = '{ foo: FooEnum::Foo, bar: !php/enum FooEnum::Foo }';
$parameters = Yaml::parse($yaml, Yaml::PARSE_CONSTANT);
// the value of the 'foo' key is a string because it missed the `!php/enum` syntax
// $parameters = ['foo' => 'FooEnum::Foo', 'bar' => FooEnum::Foo];

$yaml = '{ foo: FooEnum::Foo, bar: !php/enum FooEnum::Foo->value }';
$parameters = Yaml::parse($yaml, Yaml::PARSE_CONSTANT);
// the value of the 'foo' key is a string because it missed the `!php/enum` syntax
// $parameters = ['foo' => 'FooEnum::Foo', 'bar' => 'foo'];

.. versionadded:: 6.2

The support for PHP enumerations was introduced in Symfony 6.2.

Parsing and Dumping of Binary Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -460,3 +489,4 @@ Learn More
.. _`YAML`: https://yaml.org/
.. _`YAML 1.2 version specification`: https://yaml.org/spec/1.2/spec.html
.. _`ISO-8601`: https://www.iso.org/iso-8601-date-and-time-format.html
.. _`PHP enumerations`: https://www.php.net/manual/en/language.types.enumerations.php
7 changes: 7 additions & 0 deletions configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,13 @@ Use the ``debug:dotenv`` command to understand how Symfony parses the different
ALICE BOB BOB bob
---------- ------- ---------- ------

# look for a specific variable passing its full or partial name as an argument
$ php bin/console debug:dotenv foo

.. versionadded:: 6.2

The option to pass variable names to ``debug:dotenv`` was introduced in Symfony 6.2.

Additionally, and regardless of how you set environment variables, you can see all
environment variables, with their values, referenced in Symfony's container configuration:

Expand Down
100 changes: 100 additions & 0 deletions configuration/env_var_processors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,59 @@ Symfony provides the following env var processors:
$framework->trustedHosts(env('TRUSTED_HOSTS')->csv());
};

``env(shuffle:FOO)``
Randomly shuffles values of the ``FOO`` env var, which must be an array.

.. configuration-block::

.. code-block:: yaml

# config/packages/framework.yaml
parameters:
env(REDIS_NODES): "127.0.0.1:6380,127.0.0.1:6381"
services:
RedisCluster:
class: RedisCluster
arguments: [null, "%env(shuffle:csv:REDIS_NODES)%"]

.. code-block:: xml

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

<parameters>
<parameter key="env(REDIS_NODES)">redis://127.0.0.1:6380,redis://127.0.0.1:6381</parameter>
</parameters>

<services>
<service id="RedisCluster" class="RedisCluster">
<argument>null</argument>
<argument>%env(shuffle:csv:REDIS_NODES)%</argument>
</service>
</services>
</container>

.. code-block:: php

// config/services.php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $configurator): void {
$container = $configurator->services()
->set(\RedisCluster::class, \RedisCluster::class)->args([null, '%env(shuffle:csv:REDIS_NODES)%']);
};

.. versionadded:: 6.2

The ``env(shuffle:...)`` env var processor was introduced in Symfony 6.2.

``env(file:FOO)``
Returns the contents of a file whose path is the value of the ``FOO`` env var:

Expand Down Expand Up @@ -698,6 +751,53 @@ Symfony provides the following env var processors:
],
]);

``env(enum:FooEnum:BAR)``
Tries to convert an environment variable to an actual ``\BackedEnum`` value.
This processor takes the fully qualified name of the ``\BackedEnum`` as an argument.

.. code-block:: php

# App\Enum\Environment
enum Environment: string
{
case Development = 'dev';
case Production = 'prod';
}

.. configuration-block::

.. code-block:: yaml

# config/services.yaml
parameters:
typed_env: '%env(enum:App\Enum\Environment:APP_ENV)%'

.. code-block:: xml

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

<parameters>
<parameter key="typed_env">%env(enum:App\Enum\Environment:APP_ENV)%</parameter>
</parameters>
</container>

.. code-block:: php

// config/services.php
$container->setParameter('typed_env', '%env(enum:App\Enum\Environment:APP_ENV)%');

.. versionadded:: 6.2

The ``env(enum:...)`` env var processor was introduced in Symfony 6.2.

It is also possible to combine any number of processors:

.. configuration-block::
Expand Down
10 changes: 10 additions & 0 deletions console/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,16 @@ User Input Methods

$io->choice('Select the queue to analyze', ['queue1', 'queue2', 'queue3'], 'queue1');

Finally, you can allow users to select multiple choices. To do so, users must
separate each choice with a comma (e.g. typing ``1, 2`` will select choice 1
and 2)::

$io->choice('Select the queue to analyze', ['queue1', 'queue2', 'queue3'], multiSelect: true);

.. versionadded:: 6.2

The ``multiSelect`` option of ``choice()`` was introduced in Symfony 6.2.

Result Methods
~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion controller/argument_value_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ retrieved from the token storage::
namespace App\ArgumentResolver;

use App\Entity\User;
use Symfony\Bundle\SecurityBundle\Security\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
use Symfony\Component\Security\Core\Security;

class UserValueResolver implements ArgumentValueResolverInterface
{
Expand Down
4 changes: 2 additions & 2 deletions form/dynamic_form_modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ The problem is now to get the current user and create a choice field that
contains only this user's friends. This can be done injecting the ``Security``
service into the form type so you can get the current user object::

use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security\Security;
// ...

class FriendMessageFormType extends AbstractType
Expand All @@ -260,9 +260,9 @@ security helper to fill in the listener logic::
use App\Entity\User;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Bundle\SecurityBundle\Security\Security;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Security\Core\Security;
// ...

class FriendMessageFormType extends AbstractType
Expand Down
Loading