10000 [Workflow] deprecate `GuardEvent::getContext` method · symfony/symfony@89e5c00 · GitHub
[go: up one dir, main page]

Skip to content

Commit 89e5c00

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

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. It will throw a `\BadMethodCallException` 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. It will throw a `\BadMethodCallException` 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_error(sprintf('The %s::getContext method is deprecated and will throw a \BadMethodCallException exception in next major version. You should not longer call this method as it always returns an empty array when invoked within a guard listener.', __CLASS__), \E_USER_DEPRECATED);
38+
39+
return parent::getContext();
40+
}
41+
3542
public function getTransition(): Transition
3643
{
3744
return parent::getTransition();

0 commit comments

Comments
 (0)
0