Skip to content

Commit 2798f6f

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: Workflow - Add a note about guards events and ability to save some CPU Update firewall_restriction.rst
2 parents fd5bbeb + b89a856 commit 2798f6f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

security/firewall_restriction.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ If the above options don't fit your needs you can configure any service implemen
215215
security:
216216
firewalls:
217217
secured_area:
218-
request_matcher: app.firewall.secured_area.request_matcher
218+
request_matcher: App\Security\CustomRequestMatcher
219219
# ...
220220
221221
.. code-block:: xml
@@ -232,7 +232,7 @@ If the above options don't fit your needs you can configure any service implemen
232232
233233
<config>
234234
<!-- ... -->
235-
<firewall name="secured_area" request-matcher="app.firewall.secured_area.request_matcher">
235+
<firewall name="secured_area" request-matcher="App\Security\CustomRequestMatcher">
236236
<!-- ... -->
237237
</firewall>
238238
</config>
@@ -241,13 +241,14 @@ If the above options don't fit your needs you can configure any service implemen
241241
.. code-block:: php
242242
243243
// config/packages/security.php
244+
use App\Security\CustomRequestMatcher;
244245
use Symfony\Config\SecurityConfig;
245246
246247
return static function (SecurityConfig $security) {
247248
// ....
248249
249250
$security->firewall('secured_area')
250-
->requestMatcher('app.firewall.secured_area.request_matcher')
251+
->requestMatcher(CustomRequestMatcher::class)
251252
// ...
252253
;
253254
};

workflow.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ order:
368368
* ``workflow.[workflow name].completed``
369369
* ``workflow.[workflow name].completed.[transition name]``
370370

371-
372371
``workflow.announce``
373372
Triggered for each transition that now is accessible for the subject.
374373

@@ -378,7 +377,12 @@ order:
378377
* ``workflow.[workflow name].announce``
379378
* ``workflow.[workflow name].announce.[transition name]``
380379

381-
You can avoid triggering those events by using the context::
380+
After a transition is applied, the announce event tests for all available
381+
transitions. That will trigger all :ref:`guard events <workflow-usage-guard-events>`
382+
once more, which could impact performance if they include intensive CPU or
383+
database workloads.
384+
385+
If you don't need the announce event, disable it using the context::
382386

383387
$workflow->apply($subject, $transitionName, [Workflow::DISABLE_ANNOUNCE_EVENT => true]);
384388

@@ -494,6 +498,8 @@ missing a title::
494498
}
495499
}
496500

501+
.. _workflow-chosing-events-to-dispatch:
502+
497503
Choosing which Events to Dispatch
498504
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
499505

0 commit comments

Comments
 (0)