8000 [#10751] some minor tweaks · symfony/symfony-docs@e1e4efc · GitHub
[go: up one dir, main page]

Skip to content

Commit e1e4efc

Browse files
committed
[#10751] some minor tweaks
1 parent 85220e1 commit e1e4efc

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

contributing/documentation/overview.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,6 @@ If you don't use Docker, follow these steps to build the docs locally:
284284
285285
The generated documentation is available in the ``_build/html`` directory.
286286

287-
.. tip::
288-
289-
You can also use `Docker`_ that wraps all this for you!
290-
291287
Frequently Asked Questions
292288
--------------------------
293289

@@ -350,4 +346,3 @@ definitely don't want you to waste your time!
350346
.. _`pip installation`: https://pip.pypa.io/en/stable/installing/
351347
.. _`Sphinx`: http://sphinx-doc.org/
352348
.. _`Sphinx Extensions for PHP and Symfony`: https://github.com/fabpot/sphinx-php
353-
.. _`Docker`: https://github.com/symfony/symfony-docs#docker

workflow/state-machines.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,11 @@ you can get this state machine by injecting the Workflow registry service::
216216
// ...
217217
}
218218

219-
Symfony also creates automatically for you a service for each workflow (:class:`Symfony\\Component\\Workflow\\Workflow`) or state machine (:class:`Symfony\\Component\\Workflow\\StateMachine`) you have defined in your configuration.
220-
This means that you can use respectively ``workflow.pull_request`` or ``state_machine.pull_request`` in your service definition to have directly the proper service::
219+
Symfony automatically creates a service for each workflow (:class:`Symfony\\Component\\Workflow\\Workflow`)
220+
or state machine (:class:`Symfony\\Component\\Workflow\\StateMachine`) you
221+
have defined in your configuration. This means that you can use ``workflow.pull_request``
222+
or ``state_machine.pull_request`` respectively in your service definitions
223+
to access the proper service::
221224

222225
// ...
223226
use Symfony\Component\Workflow\StateMachine;

workflow/usage.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line chang 8000 e
@@ -43,7 +43,7 @@ like this:
4343
audit_trail:
4444
enabled: true
4545
marking_store:
46-
type: 'multiple_state' # or 'single_state', 'method' ('method' was added in 4.3)
46+
type: 'multiple_state' # one of 'single_state', 'multiple_state', 'method'
4747
arguments:
4848
- 'currentPlace'
4949
supports:
@@ -126,7 +126,7 @@ like this:
126126
'enabled' => true
127127
],
128128
'marking_store' => [
129-
'type' => 'multiple_state', // or 'single_state', 'method' ('method' was added in 4.3)
129+
'type' => 'multiple_state', // one of 'single_state', 'multiple_state', 'method'
130130
'arguments' => ['currentPlace'],
131131
],
132132
'supports' => ['App\Entity\BlogPost'],
@@ -170,6 +170,10 @@ As configured, the following property is used by the marking store::
170170
A single state marking store does not support a model being on multiple places
171171
at the same time.
172172

173+
versionadded:: 4.3
174+
175+
The ``method`` marking store type was introduced in Symfony 4.3.
176+
173177
.. tip::
174178

175179
The ``type`` (default value ``single_state``) and ``arguments`` (default
@@ -245,14 +249,17 @@ you can get the workflow by injecting the Workflow registry service::
245249
The :method:`Symfony\\Component\\Workflow\\Registry::all` method was
246250
introduced in Symfony 4.1.
247251

248-
.. versionadded:: 4.3
252+
You can pass some context as the second argument of the ``apply()`` method.
253+
This can be useful when the subject not only needs to apply a transition,
254+
but for example you also want to log the context in which the switch happened.
249255

250-
The :method:`Symfony\\Component\\Workflow\\Workflow::apply` has now a new parameter ``$context``
251-
that is passed to the :class:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface`
252-
:method:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface::setMarking` method.
256+
This context is forwarded to the :method:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface::setMarking`
257+
method of the marking store.
258+
259+
.. versionadded:: 4.3
253260

254-
An example of usage with the ``$context`` parameter can be when you need,
255-
in addition of marking your object in its new place, to contextualize this change.
261+
The ``$context`` argument of the :method:`Symfony\\Component\\Workflow\\Workflow::apply`
262+
method was introduced in Symfony 4.3.
256263

257264
.. tip::
258265

0 commit comments

Comments
 (0)
2A6A
0