Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Workflow] minor doc improvement#11845

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
OskarStark merged 1 commit intosymfony:4.3fromnoniagriconomie:patch-5
Aug 2, 2019
Merged
Changes fromall 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 deletionsworkflow/introduction.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp