@@ -239,6 +239,7 @@ In a Symfony application using the
239239you 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
267268to 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