Skip to content

Commit 7a94e5e

Browse files
committed
[Workflow] Fixed BC break with MarkingStoreInterface::setMarking()
1 parent 29f81b0 commit 7a94e5e

File tree

5 files changed

+35
-4
lines changed

5 files changed

+35
-4
lines changed

UPGRADE-4.3.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,28 @@ Yaml
116116
----
117117

118118
* Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0.
119+
120+
Workflow
121+
--------
122+
123+
* `MarkingStoreInterface::setMarking()` will have a third argument in Symfony 5.0.
124+
125+
Before:
126+
```php
127+
class MyMarkingStore implements MarkingStoreInterface
128+
{
129+
public function setMarking($subject, Marking $marking)
130+
{
131+
}
132+
}
133+
```
134+
135+
After:
136+
```php
137+
class MyMarkingStore implements MarkingStoreInterface
138+
{
139+
public function setMarking($subject, Marking $marking , array $context = [])
140+
{
141+
}
142+
}
143+
```

UPGRADE-5.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Finder
8484

8585
Form
8686
----
87-
87+
8888
* Removed support for using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled.
8989
* Using names for buttons that do not start with a letter, a digit, or an underscore leads to an exception.
9090
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons leads to an
@@ -352,6 +352,7 @@ Workflow
352352
* `add` method has been removed use `addWorkflow` method in `Workflow\Registry` instead.
353353
* `SupportStrategyInterface` has been removed, use `WorkflowSupportStrategyInterface` instead.
354354
* `ClassInstanceSupportStrategy` has been removed, use `InstanceOfSupportStrategy` instead.
355+
* `MarkingStoreInterface::setMarking()` has a third argument: `array $context = []`.
355356

356357
Yaml
357358
----

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function getMarking($subject);
3737
* Sets a Marking to a subject.
3838
*
3939
* @param object $subject A subject
40+
* @param array $context Some context
4041
*/
41-
public function setMarking($subject, Marking $marking, array $context = []);
42+
public function setMarking($subject, Marking $marking /*, array $context = []*/);
4243
}

src/Symfony/Component/Workflow/MarkingStore/MultipleStateMarkingStore.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public function getMarking($subject)
4545

4646
/**
4747
* {@inheritdoc}
48+
*
49+
* @param array $context Some context
4850
*/
49-
public function setMarking($subject, Marking $marking, array $context = [])
51+
public function setMarking($subject, Marking $marking/*, array $context = []*/)
5052
{
5153
$this->propertyAccessor->setValue($subject, $this->property, $marking->getPlaces());
5254
}

src/Symfony/Component/Workflow/MarkingStore/SingleStateMarkingStore.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ public function getMarking($subject)
5050

5151
/**
5252
* {@inheritdoc}
53+
*
54+
* @param array $context Some context
5355
*/
54-
public function setMarking($subject, Marking $marking, array $context = [])
56+
public function setMarking($subject, Marking $marking/*, array $context = []*/)
5557
{
5658
$this->propertyAccessor->setValue($subject, $this->property, key($marking->getPlaces()));
5759
}

0 commit comments

Comments
 (0)