Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit abe2745

Browse filesBrowse files
committed
bug #33835 [Workflow] Fixed BC break on WorkflowInterface (lyrixx)
This PR was merged into the 4.3 branch. Discussion ---------- [Workflow] Fixed BC break on WorkflowInterface | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- 1eb10b9 [Workflow] Fixed BC break on WorkflowInterface
2 parents 766162c + 1eb10b9 commit abe2745
Copy full SHA for abe2745

File tree

5 files changed

+31
-3
lines changed
Filter options

5 files changed

+31
-3
lines changed

‎UPGRADE-4.3.md

Copy file name to clipboardExpand all lines: UPGRADE-4.3.md
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,28 @@ Workflow
242242
initial_marking: [draft]
243243
```
244244

245+
* `WorkflowInterface::apply()` will have a third argument in Symfony 5.0.
246+
247+
Before:
248+
```php
249+
class MyWorkflow implements WorkflowInterface
250+
{
251+
public function apply($subject, $transitionName)
252+
{
253+
}
254+
}
255+
```
256+
257+
After:
258+
```php
259+
class MyWorkflow implements WorkflowInterface
260+
{
261+
public function apply($subject, $transitionName, array $context = [])
262+
{
263+
}
264+
}
265+
```
266+
245267
* `MarkingStoreInterface::setMarking()` will have a third argument in Symfony 5.0.
246268

247269
Before:

‎UPGRADE-5.0.md

Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ Workflow
414414
* `add` method has been removed use `addWorkflow` method in `Workflow\Registry` instead.
415415
* `SupportStrategyInterface` has been removed, use `WorkflowSupportStrategyInterface` instead.
416416
* `ClassInstanceSupportStrategy` has been removed, use `InstanceOfSupportStrategy` instead.
417+
* `WorkflowInterface::apply()` has a third argument: `array $context = []`.
417418
* `MarkingStoreInterface::setMarking()` has a third argument: `array $context = []`.
418419
* Removed support of `initial_place`. Use `initial_places` instead.
419420
* `MultipleStateMarkingStore` has been removed. Use `MethodMarkingStore` instead.

‎src/Symfony/Component/Workflow/MarkingStore/MarkingStoreInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/MarkingStore/MarkingStoreInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ public function getMarking($subject);
3939
* @param object $subject A subject
4040
* @param array $context Some context
4141
*/
42-
public function setMarking($subject, Marking $marking /*, array $context = []*/);
42+
public function setMarking($subject, Marking $marking/*, array $context = []*/);
4343
}

‎src/Symfony/Component/Workflow/Workflow.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/Workflow.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,13 @@ public function buildTransitionBlockerList($subject, string $transitionName): Tr
150150

151151
/**
152152
* {@inheritdoc}
153+
*
154+
* @param array $context Some context
153155
*/
154-
public function apply($subject, $transitionName, array $context = [])
156+
public function apply($subject, $transitionName/*, array $context = []*/)
155157
{
158+
$context = \func_get_args()[2] ?? [];
159+
156160
$marking = $this->getMarking($subject);
157161

158162
$transitionBlockerList = null;

‎src/Symfony/Component/Workflow/WorkflowInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/WorkflowInterface.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ public function buildTransitionBlockerList($subject, string $transitionName): Tr
5353
*
5454
* @param object $subject A subject
5555
* @param string $transitionName A transition
56+
* @param array $context Some context
5657
*
5758
* @return Marking The new Marking
5859
*
5960
* @throws LogicException If the transition is not applicable
6061
*/
61-
public function apply($subject, $transitionName, array $context = []);
62+
public function apply($subject, $transitionName/*, array $context = []*/);
6263

6364
/**
6465
* Returns all enabled transitions.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.