Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit1eb10b9

Browse files
committed
[Workflow] Fixed BC break on WorkflowInterface
1 parent766162c commit1eb10b9

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

‎UPGRADE-4.3.md‎

Lines 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‎

Lines 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‎

Lines 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-
publicfunctionsetMarking($subject,Marking$marking/*, array $context = []*/);
42+
publicfunctionsetMarking($subject,Marking$marking/*, array $context = []*/);
4343
}

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

Lines 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-
publicfunctionapply($subject,$transitionName,array$context = [])
156+
publicfunctionapply($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‎

Lines 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-
publicfunctionapply($subject,$transitionName,array$context = []);
62+
publicfunctionapply($subject,$transitionName/*, array $context = []*/);
6263

6364
/**
6465
* Returns all enabled transitions.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp