8000 [Workflow] deprecate `GuardEvent::getContext` method by hhamon · Pull Request #51484 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Workflow] deprecate GuardEvent::getContext method #51484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADE-6.4.md 8000
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/Symfony/Component/Workflow/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
7 changes: 7 additions & 0 deletions src/Symfony/Component/Workflow/Event/GuardEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
0