8000 [Workflow] minor doc improvement by noniagriconomie · Pull Request #11845 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Workflow] minor doc improvement #11845

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions workflow/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
// ...
}

Expand All @@ -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
Expand All @@ -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.',
]);
// ...
Expand Down
0