From 7d88725acfd5d7bbb041da668290d7a26df0917d Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Fri, 28 Jun 2019 08:49:08 +0200 Subject: [PATCH] Update introduction.rst --- workflow/introduction.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/workflow/introduction.rst b/workflow/introduction.rst index 58322183201..c8302870ac1 100644 --- a/workflow/introduction.rst +++ b/workflow/introduction.rst @@ -239,6 +239,7 @@ In a Symfony application using the you can get this state machine by injecting the Workflow registry service:: // ... + use App\Entity\PullRequest; use Symfony\Component\Workflow\Registry; class SomeService @@ -250,10 +251,10 @@ you can get this state machine by injecting the Workflow registry service:: $this->workflows = $workflows; } - public function someMethod($subject) + public function someMethod(PullRequest $pullRequest) { - $stateMachine = $this->workflows->get($subject, 'pull_request'); - $stateMachine->apply($subject, 'wait_for_review'); + $stateMachine = $this->workflows->get($pullRequest, 'pull_request'); + $stateMachine->apply($pullRequest, 'wait_for_review'); // ... } @@ -267,6 +268,7 @@ or ``state_machine.pull_request`` respectively in your service definitions to access the proper service:: // ... + use App\Entity\PullRequest; use Symfony\Component\Workflow\StateMachine; class SomeService @@ -278,9 +280,9 @@ to access the proper service:: $this->stateMachine = $stateMachine; } - public function someMethod($subject) + public function someMethod(PullRequest $pullRequest) { - $this->stateMachine->apply($subject, 'wait_for_review', [ + $this->stateMachine->apply($pullRequest, 'wait_for_review', [ 'log_comment' => 'My logging comment for the wait for review transition.', ]); // ... pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy