`, which are always fired:
// config/packages/workflow.php
use Symfony\Config\FrameworkConfig;
- return static function (FrameworkConfig $framework) {
+ return static function (FrameworkConfig $framework): void {
// ...
$blogPublishing = $framework->workflows()->workflows('blog_publishing');
@@ -724,7 +724,7 @@ transition. The value of this option is any valid expression created with the
// config/packages/workflow.php
use Symfony\Config\FrameworkConfig;
- return static function (FrameworkConfig $framework) {
+ return static function (FrameworkConfig $framework): void {
$blogPublishing = $framework->workflows()->workflows('blog_publishing');
// ... previous configuration
@@ -769,7 +769,7 @@ place::
class BlogPostPublishSubscriber implements EventSubscriberInterface
{
- public function guardPublish(GuardEvent $event)
+ public function guardPublish(GuardEvent $event): void
{
$eventTransition = $event->getTransition();
$hourLimit = $event->getMetadata('hour_limit', $eventTransition);
@@ -784,7 +784,7 @@ place::
$event->addTransitionBlocker(new TransitionBlocker($explanation , '0'));
}
- public static function getSubscribedEvents()
+ public static function getSubscribedEvents(): array
{
return [
'workflow.blog_publishing.guard.publish' => ['guardPublish'],
@@ -935,7 +935,7 @@ be only the title of the workflow or very complex objects:
// config/packages/workflow.php
use Symfony\Config\FrameworkConfig;
- return static function (FrameworkConfig $framework) {
+ return static function (FrameworkConfig $framework): void {
$blogPublishing = $framework->workflows()->workflows('blog_publishing');
// ... previous configuration
@@ -978,7 +978,7 @@ Then you can access this metadata in your controller as follows::
use Symfony\Component\Workflow\WorkflowInterface;
// ...
- public function myAction(WorkflowInterface $blogPublishingWorkflow, BlogPost $post)
+ public function myAction(WorkflowInterface $blogPublishingWorkflow, BlogPost $post): Response
{
$title = $blogPublishingWorkflow
->getMetadataStore()
diff --git a/workflow/dumping-workflows.rst b/workflow/dumping-workflows.rst
index d4c979133fc..de79270db7d 100644
--- a/workflow/dumping-workflows.rst
+++ b/workflow/dumping-workflows.rst
@@ -246,7 +246,7 @@ Below is the configuration for the pull request state machine with styling added
// config/packages/workflow.php
use Symfony\Config\FrameworkConfig;
- return static function (FrameworkConfig $framework) {
+ return static function (FrameworkConfig $framework): void {
// ...
$pullRequest = $framework->workflows()->workflows('pull_request');
diff --git a/workflow/workflow-and-state-machine.rst b/workflow/workflow-and-state-machine.rst
index 3884af25059..12ee935cd8a 100644
--- a/workflow/workflow-and-state-machine.rst
+++ b/workflow/workflow-and-state-machine.rst
@@ -194,7 +194,7 @@ Below is the configuration for the pull request state machine.
// config/packages/workflow.php
use Symfony\Config\FrameworkConfig;
- return static function (FrameworkConfig $framework) {
+ return static function (FrameworkConfig $framework): void {
$pullRequest = $framework->workflows()->workflows('pull_request');
$pullRequest
@@ -268,7 +268,7 @@ machine type, use ``camelCased workflow name + StateMachine``::
) {
}
- public function someMethod(PullRequest $pullRequest)
+ public function someMethod(PullRequest $pullRequest): void
{
$this->pullRequestWorkflow->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