Skip to content

Commit 9d25964

Browse files
committed
Merge remote-tracking branch 'upstream/7.3' into 7.3
* upstream/7.3: Add a few words about core team member responsibilities Fix 2 small grammar errors/6.4 [Validator] Add support for the `otherwise` option in the `When` constraint [Mailer] Minor reformating Minor tweak [Frontend] Correct "Removes comments from CSS" comparison [symfony#20337] fix typo
2 parents ef5e233 + 4955cc7 commit 9d25964

File tree

6 files changed

+56
-9
lines changed

6 files changed

+56
-9
lines changed

contributing/code/core_team.rst

+12-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,25 @@ This document states the rules that govern the Symfony core team. These rules
1313
are effective upon publication of this document and all Symfony Core members
1414
must adhere to said rules and protocol.
1515

16-
Role of a Core Team Member
17-
--------------------------
16+
Core Team Member Role
17+
---------------------
1818

1919
In addition to being a regular contributor, core team members are expected to:
2020

2121
* Review, approve, and merge pull requests;
2222
* Help enforce, improve, and implement Symfony :doc:`processes and policies </contributing/index>`;
2323
* Participate in the Symfony Core Team discussions (on Slack and GitHub).
2424

25+
Core Team Member Responsibilities
26+
---------------------------------
27+
28+
Core Team members are unpaid volunteers and as such, they are not expected to
29+
dedicate any specific amount of time on Symfony. They are expected to help the
30+
project in any way they can, from reviewing pull requests, writing documentation
31+
to participating in discussions and helping the community in general, but their
32+
involvement is completely voluntary and can be as much or as little as they
33+
want.
34+
2535
Core Organization
2636
-----------------
2737

doctrine/events.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Doctrine Events
33

44
`Doctrine`_, the set of PHP libraries used by Symfony to work with databases,
55
provides a lightweight event system to update entities during the application
6-
execution. These events, called `lifecycle events`_, allow to perform tasks such
6+
execution. These events, called `lifecycle events`_, allow performing tasks such
77
as *"update the createdAt property automatically right before persisting entities
88
of this type"*.
99

@@ -24,7 +24,7 @@ There are different ways to listen to these Doctrine events:
2424
methods are called for all entities, not only those of a certain type. They are
2525
ideal to **share event logic between entities**.
2626

27-
The performance of each type of listener depends on how many entities applies to:
27+
The performance of each type of listener depends on how many entities it applies to:
2828
lifecycle callbacks are faster than entity listeners, which in turn are faster
2929
than lifecycle listeners.
3030

frontend.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Supports Sass/Tailwind :ref:`yes <asset-mapper-tailwind>` yes
3535
Supports React, Vue, Svelte? yes :ref:`[1] <ux-note-1>` yes
3636
Supports TypeScript :ref:`yes <asset-mapper-ts>` yes
3737
Removes comments from JavaScript no :ref:`[2] <ux-note-2>` yes
38-
Removes comments from CSS no :ref:`[2] <ux-note-2>` no
38+
Removes comments from CSS no :ref:`[2] <ux-note-2>` yes :ref:`[4] <ux-note-4>`
3939
Versioned assets always optional
4040
Can update 3rd party packages yes no :ref:`[3] <ux-note-3>`
4141
================================ ================================== ==========
@@ -56,6 +56,11 @@ be executed by a browser.
5656

5757
**[3]** If you use ``npm``, there are update checkers available (e.g. ``npm-check``).
5858

59+
.. _ux-note-4:
60+
61+
**[4]** CSS comments can be removed using `CssMinimizerPlugin`_, which is included
62+
in Webpack Encore and configurable via ``Encore.configureCssMinimizerPlugin()``.
63+
5964
.. _frontend-asset-mapper:
6065

6166
AssetMapper (Recommended)
@@ -153,3 +158,4 @@ Other Front-End Articles
153158
.. _`SensioLabs Minify Bundle`: https://github.com/sensiolabs/minify-bundle
154159
.. _`AssetMapper screencast series`: https://symfonycasts.com/screencast/asset-mapper
155160
.. _`API Platform screencast series`: https://symfonycasts.com/screencast/api-platform
161+
.. _`CssMinimizerPlugin`: https://webpack.js.org/plugins/css-minimizer-webpack-plugin

mailer.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,8 @@ header, etc.) but most of the times you'll set text headers::
661661

662662
$email = (new Email())
663663
->getHeaders()
664-
// this non-standard header tells compliant autoresponders ("email holiday mode") to not
665-
// reply to this message because it's an automated email
664+
// this non-standard header tells compliant autoresponders ("email holiday mode")
665+
// to not reply to this message because it's an automated email
666666
->addTextHeader('X-Auto-Response-Suppress', 'OOF, DR, RN, NRN, AutoReply')
667667

668668
// use an array if you want to add a header with multiple values

messenger.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2937,7 +2937,7 @@ and a different instance will be created per bus.
29372937
.. tip::
29382938

29392939
If you have installed the MakerBundle, you can use the ``make:messenger-middleware``
2940-
command to bootstrap the creation your own messenger middleware.
2940+
command to bootstrap the creation of your own messenger middleware.
29412941

29422942
.. _middleware-doctrine:
29432943

reference/constraints/When.rst

+32-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Applies to :ref:`class <validation-class-target>`
99
or :ref:`property/method <validation-property-target>`
1010
Options - `expression`_
1111
- `constraints`_
12+
_ `otherwise`_
1213
- `groups`_
1314
- `payload`_
1415
- `values`_
@@ -47,7 +48,7 @@ properties::
4748
To validate the object, you have some requirements:
4849

4950
A) If ``type`` is ``percent``, then ``value`` must be less than or equal 100;
50-
B) If ``type`` is ``absolute``, then ``value`` can be anything;
51+
B) If ``type`` is not ``percent``, then ``value`` must be less than 9999;
5152
C) No matter the value of ``type``, the ``value`` must be greater than 0.
5253

5354
One way to accomplish this is with the When constraint:
@@ -69,6 +70,9 @@ One way to accomplish this is with the When constraint:
6970
constraints: [
7071
new Assert\LessThanOrEqual(100, message: 'The value should be between 1 and 100!')
7172
],
73+
otherwise: [
74+
new Assert\LessThan(9999, message: 'The value should be less than 9999!')
75+
],
7276
)]
7377
private ?int $value;
7478
@@ -88,6 +92,10 @@ One way to accomplish this is with the When constraint:
8892
- LessThanOrEqual:
8993
value: 100
9094
message: "The value should be between 1 and 100!"
95+
otherwise:
96+
- LessThan:
97+
value: 9999
98+
message: "The value should be less than 9999!"
9199
92100
.. code-block:: xml
93101
@@ -109,6 +117,12 @@ One way to accomplish this is with the When constraint:
109117
<option name="message">The value should be between 1 and 100!</option>
110118
</constraint>
111119
</option>
120+
<option name="otherwise">
121+
<constraint name="LessThan">
122+
<option name="value">9999</option>
123+
<option name="message">The value should be less than 9999!</option>
124+
</constraint>
125+
</option>
112126
</constraint>
113127
</property>
114128
</class>
@@ -135,6 +149,12 @@ One way to accomplish this is with the When constraint:
135149
message: 'The value should be between 1 and 100!',
136150
),
137151
],
152+
otherwise: [
153+
new Assert\LessThan(
154+
value: 9999,
155+
message: 'The value should be less than 9999!',
156+
),
157+
],
138158
));
139159
}
140160
@@ -279,6 +299,17 @@ You can also pass custom variables using the `values`_ option.
279299

280300
One or multiple constraints that are applied if the expression returns true.
281301

302+
``otherwise``
303+
~~~~~~~~~~~~~
304+
305+
**type**: ``array|Constraint``
306+
307+
One or multiple constraints that are applied if the expression returns false.
308+
309+
.. versionadded:: 7.3
310+
311+
The ``otherwise`` option was introduced in Symfony 7.3.
312+
282313
.. include:: /reference/constraints/_groups-option.rst.inc
283314

284315
.. include:: /reference/constraints/_payload-option.rst.inc

0 commit comments

Comments
 (0)