From 985b9db0a7e1c114da400dd8655cd8642b94f257 Mon Sep 17 00:00:00 2001 From: Hugo Hamon Date: Fri, 25 Aug 2023 14:40:50 +0200 Subject: [PATCH] [Workflow] deprecate `GuardEvent::getContext` method --- UPGRADE-6.4.md | 5 +++++ src/Symfony/Component/Workflow/CHANGELOG.md | 1 + src/Symfony/Component/Workflow/Event/GuardEvent.php | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/UPGRADE-6.4.md b/UPGRADE-6.4.md index 02dcde114bd9d..ddfc9883a5acc 100644 --- a/UPGRADE-6.4.md +++ b/UPGRADE-6.4.md @@ -162,3 +162,8 @@ Validator * Deprecate `ValidatorBuilder::enableAnnotationMapping()`, use `ValidatorBuilder::enableAttributeMapping()` instead * Deprecate `ValidatorBuilder::disableAnnotationMapping()`, use `ValidatorBuilder::disableAttributeMapping()` instead * Deprecate `AnnotationLoader`, use `AttributeLoader` instead + +Workflow +-------- + +* Deprecate `GuardEvent::getContext()` method that will be removed in 7.0 diff --git a/src/Symfony/Component/Workflow/CHANGELOG.md b/src/Symfony/Component/Workflow/CHANGELOG.md index ecc900ebc4e85..5089019c556c0 100644 --- a/src/Symfony/Component/Workflow/CHANGELOG.md +++ b/src/Symfony/Component/Workflow/CHANGELOG.md @@ -10,6 +10,7 @@ CHANGELOG * Add a profiler * Add support for multiline descriptions in PlantUML diagrams * Add PHP attributes to register listeners and guards + * Deprecate `GuardEvent::getContext()` method that will be removed in 7.0 6.2 --- diff --git a/src/Symfony/Component/Workflow/Event/GuardEvent.php b/src/Symfony/Component/Workflow/Event/GuardEvent.php index 9409da2059664..fe8ba35bff338 100644 --- a/src/Symfony/Component/Workflow/Event/GuardEvent.php +++ b/src/Symfony/Component/Workflow/Event/GuardEvent.php @@ -32,6 +32,13 @@ public function __construct(object $subject, Marking $marking, Transition $trans $this->transitionBlockerList = new TransitionBlockerList(); } + public function getContext(): array + { + trigger_deprecation('symfony/workflow', '6.4', 'The %s::getContext() method is deprecated and will be removed in 7.0. You should no longer call this method as it always returns an empty array when invoked within a guard listener.', __CLASS__); + + return parent::getContext(); + } + public function getTransition(): Transition { return parent::getTransition(); 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