@@ -239,6 +239,7 @@ In a Symfony application using the
239
239
you can get this state machine by injecting the Workflow registry service::
240
240
241
241
// ...
242
+ use App\Entity\PullRequest;
242
243
use Symfony\Component\Workflow\Registry;
243
244
244
245
class SomeService
@@ -250,10 +251,10 @@ you can get this state machine by injecting the Workflow registry service::
250
251
$this->workflows = $workflows;
251
252
}
252
253
253
- public function someMethod($subject )
254
+ public function someMethod(PullRequest $pullRequest )
254
255
{
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');
257
258
// ...
258
259
}
259
260
@@ -267,6 +268,7 @@ or ``state_machine.pull_request`` respectively in your service definitions
267
268
to access the proper service::
268
269
269
270
// ...
271
+ use App\Entity\PullRequest;
270
272
use Symfony\Component\Workflow\StateMachine;
271
273
272
274
class SomeService
@@ -278,9 +280,9 @@ to access the proper service::
278
280
$this->stateMachine = $stateMachine;
279
281
}
280
282
281
- public function someMethod($subject )
283
+ public function someMethod(PullRequest $pullRequest )
282
284
{
283
- $this->stateMachine->apply($subject , 'wait_for_review', [
285
+ $this->stateMachine->apply($pullRequest , 'wait_for_review', [
284
286
'log_comment' => 'My logging comment for the wait for review transition.',
285
287
]);
286
288
// ...
0 commit comments