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

Commit8a7f7c5

Browse files
Review
1 parent55fc4b8 commit8a7f7c5

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

‎contributing/documentation/overview.rst‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ purposes following these steps:
270270
271271
The generated documentation is available in the ``_build/html`` directory.
272272

273-
You can also use Docker that wraps all this for you, please visit https://github.com/symfony/symfony-docs#docker.
273+
..tip::
274+
275+
You can also use `Docker`_ that wraps all this for you!
274276

275277
Frequently Asked Questions
276278
--------------------------
@@ -334,3 +336,4 @@ definitely don't want you to waste your time!
334336
.. _`pip installation`:https://pip.pypa.io/en/stable/installing/
335337
.. _`Sphinx`:http://sphinx-doc.org/
336338
.. _`Sphinx Extensions for PHP and Symfony`:https://github.com/fabpot/sphinx-php
339+
.. _`Docker`:https://github.com/symfony/symfony-docs#docker

‎workflow.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ best kept away from your models and should be defined in configuration.
88

99
A **definition** of a workflow consist of places and actions to get from one
1010
place to another. The actions are called **transitions**. A workflow does also
11-
need to know each object's position in the workflow. This is the goal of the
12-
**marking store** that writes to a property of the object, or somewhere else, the current **place(s)**
11+
need to know eachposition anobject can be in the workflow. This is the goal of the
12+
**marking store** thatreads from andwrites to a property of the object, or somewhere else, the current **place(s)**
1313
to remember.
1414

1515
..note::

‎workflow/state-machines.rst‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ you can get this state machine by injecting the Workflow registry service::
217217
}
218218

219219
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.
221-
222-
::
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::
223221

224222
// ...
225223
use Symfony\Component\Workflow\StateMachine;
@@ -236,7 +234,7 @@ This means that you can use respectively ``workflow.pull_request`` or ``state_ma
236234
public function someMethod($subject)
237235
{
238236
$this->stateMachine->apply($subject, 'wait_for_review', [
239-
'log_comment' => 'My logging comment for the wait for review transition.'
237+
'log_comment' => 'My logging comment for the wait for review transition.',
240238
]);
241239
// ...
242240
}

‎workflow/usage.rst‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ you can get the workflow by injecting the Workflow registry service::
225225
// to the whole workflow process
226226
try {
227227
$workflow->apply($post, 'publish', [
228-
'log_comment' => 'My logging comment for the publish transition.'
228+
'log_comment' => 'My logging comment for the publish transition.',
229229
]);
230230
} catch (TransitionException $exception) {
231231
// ... if the transition is not allowed
@@ -237,33 +237,34 @@ you can get the workflow by injecting the Workflow registry service::
237237
}
238238

239239
..versionadded::4.1
240+
240241
The:class:`Symfony\\Component\\Workflow\\Exception\\TransitionException`
241242
class was introduced in Symfony 4.1.
242243

243244
..versionadded::4.1
245+
244246
The:method:`Symfony\\Component\\Workflow\\Registry::all` method was
245247
introduced in Symfony 4.1.
246248

247249
..versionadded::4.3
250+
248251
The:method:`Symfony\\Component\\Workflow\\Workflow::apply` has now a new parameter ``$context``
249252
that is passed to the:class:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface`
250253
:method:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface::setMarking` method.
251254

252-
An example of usage with the ``$context`` parameter can be when you need, in addition of marking your object
253-
in its new place, to contextualize this change.
255+
An example of usage with the ``$context`` parameter can be when you need,
256+
inaddition of marking your object inits new place, to contextualize this change.
254257

255258
..tip::
256259

257260
Configure the ``type`` as ``method`` of the ``marking_store`` option to use this feature
258-
without implementing your own marking store (``method`` was added in 4.3).
261+
without implementing your own marking store.
259262

260263
You can also use this ``$context`` in your own marking store implementation.
261264
A simple implementation example is when you want to store the place as integer instead of string in your object.
262265

263266
Lets say your object has a status property, stored as an integer in your storage, and you want to log an optional
264-
comment any time the status changes.
265-
266-
..code-block::php
267+
comment any time the status changes::
267268

268269
// your own implementation class, to define in the configuration "marking_store"
269270

@@ -299,7 +300,7 @@ comment any time the status changes.
299300
}
300301

301302
// the StatusLog class can have a createdAt, a username,
302-
// the new status, and finally your optional commentretrived from the workflow context.
303+
// the new status, and finally your optional commentretrieved from the workflow context.
303304

304305
Using Events
305306
------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp