8000 minor #11845 [Workflow] minor doc improvement (noniagriconomie) · symfony/symfony-docs@35bdc5f · GitHub
[go: up one dir, main page]

Skip to content

Commit 35bdc5f

Browse files
committed
minor #11845 [Workflow] minor doc improvement (noniagriconomie)
This PR was merged into the 4.3 branch. Discussion ---------- [Workflow] minor doc improvement Hi, IMO using a good named var is better it is a better understanding after reading the first part describing a pull request configuration Commits ------- 7d88725 Update introduction.rst
2 parents 2fa5fa3 + 7d88725 commit 35bdc5f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

workflow/introduction.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ In a Symfony application using the
239239
you can get this state machine by injecting the Workflow registry service::
240240

241241
// ...
242+
use App\Entity\PullRequest;
242243
use Symfony\Component\Workflow\Registry;
243244

244245
class SomeService
@@ -250,10 +251,10 @@ you can get this state machine by injecting the Workflow registry service::
250251
$this->workflows = $workflows;
251252
}
252253

253-
public function someMethod($subject)
254+
public function someMethod(PullRequest $pullRequest)
254255
{
255-
$stateMachine = $this->workflows->get($subject, 'pull_request');
256-
$stateMachine->apply($subject, 'wait_for_review');
256+
$stateMachine = $this->workflows->get($pullRequest, 'pull_request');
257+
$stateMachine->apply($pullRequest, 'wait_for_review');
257258
// ...
258259
}
259260

@@ -267,6 +268,7 @@ or ``state_machine.pull_request`` respectively in your service definitions
267268
to access the proper service::
268269

269270
// ...
271+
use App\Entity\PullRequest;
270272
use Symfony\Component\Workflow\StateMachine;
271273

272274
class SomeService
@@ -278,9 +280,9 @@ to access the proper service::
278280
$this->stateMachine = $stateMachine;
279281
}
280282

281-
public function someMethod($subject)
283+
public function someMethod(PullRequest $pullRequest)
282284
{
283-
$this->stateMachine->apply($subject, 'wait_for_review', [
285+
$this->stateMachine->apply($pullRequest, 'wait_for_review', [
284286
'log_comment' => 'My logging comment for the wait for review transition.',
285287
]);
286288
// ...

0 commit comments

Comments
 (0)
0