Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Commitedd1cb4
committed
feature#51484 [Workflow] deprecate
This PR was merged into the 6.4 branch.Discussion----------[Workflow] deprecate `GuardEvent::getContext` method| Q | A| ------------- | ---| Branch? | 6.4| Bug fix? | no| New feature? | no| Deprecations? | yes| Tickets | ~| License | MIT| Doc PR | ~As discussed with `@lyrixx`, this method is confusing as the context given as the 3rd argument to the `WorflowInterface::appy()` method is never passed along to the guard events. According to `@lyrixx`, the guard listeners must take any decisions based on the subject itself and not on the given contextual data (which are supposed to remain metadata). As a consequence, calling the `getContext` method on a `GuardEvent` object always returns an empty context.To prevent confusion and lower the BC breakage in 7.x, we advocate for deprecating this method in 6.4 and make it throw an exception in 7.0. Application codes should not call this method anyway as it always returns an empty array.EDIT: a second approach in Symfony 7.x is to remove the `getContext` method from the base abstract class and reimplement it as a dedicated trait that is used by all the other event classes except `GuardEvent`. This approach is probably a bit cleaner as the method will completly be dropped from the `GuardEvent` class scope.Any thoughts?Commits-------985b9db [Workflow] deprecate `GuardEvent::getContext` methodGuardEvent::getContext method (hhamon)File tree
3 files changed
+13
-0
lines changed- src/Symfony/Component/Workflow
- Event
3 files changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
| |||
0 commit comments
Comments
(0)