diff --git a/UPGRADE-6.4.md b/UPGRADE-6.4.md index 02dcde114bd9..ddfc9883a5ac 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 ecc900ebc4e8..5089019c556c 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 9409da205966..fe8ba35bff33 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();