8000 [Workflow] deprecate `GuardEvent::getContext` method · symfony/symfony@985b9db · GitHub
[go: up one dir, main page]

Skip to content

Commit 985b9db

Browse files
committed
[Workflow] deprecate GuardEvent::getContext method
1 parent 62e115f commit 985b9db

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

UPGRADE-6.4.md

+5
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,8 @@ Validator
162162
* Deprecate `ValidatorBuilder::enableAnnotationMapping()`, use `ValidatorBuilder::enableAttributeMapping()` instead
163163
* Deprecate `ValidatorBuilder::disableAnnotationMapping()`, use `ValidatorBuilder::disableAttributeMapping()` instead
164164
* Deprecate `AnnotationLoader`, use `AttributeLoader` instead
165+
166+
Workflow
167+
--------
168+
169+
* Deprecate `GuardEvent::getContext()` method that will be removed in 7.0

src/Symfony/Component/Workflow/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CHANGELOG
1010
* Add a profiler
1111
* Add support for multiline descriptions in PlantUML diagrams
1212
* Add PHP attributes to register listeners and guards
13+
* Deprecate `GuardEvent::getContext()` method that will be removed in 7.0
1314

1415
6.2
1516
---

src/Symfony/Component/Workflow/Event/GuardEvent.php

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ public function __construct(object $subject, Marking $marking, Transition $trans
3232
$this->transitionBlockerList = new TransitionBlockerList();
3333
}
3434

35+
public function getContext(): array
36+
{
37+
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__);
38+
39+
return parent::getContext();
40+
}
41+
3542
public function getTransition(): Transition
3643
{
3744
return parent::getTransition();

0 commit comments

Comments
 (0)
0