Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

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

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

There isno 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 thecontroller, then this listener renders a template,
passes the arrayyou returned from your controller to that template, and
creates a ``Response``containing the returned content from that template.
There isa 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 DownExpand 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 deletionscomponents/uid.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 deletionscomponents/yaml.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 deletionsconfiguration.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsconfiguration/env_var_processors.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 deletionsconsole/style.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletioncontroller/argument_value_resolver.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsform/dynamic_form_modification.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp