Skip to content

Commit

Permalink
[Workflow] Fixed BC break with MarkingStoreInterface::setMarking()
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrixx committed Mar 13, 2019
1 parent 29f81b0 commit ccd4b18
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
25 changes: 25 additions & 0 deletions UPGRADE-4.3.md
Expand Up @@ -116,3 +116,28 @@ Yaml
----

* Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0.

Workflow
--------

* `MarkingStoreInterface::setMarking()` will have a third argument in Symfony 5.0.

Before:
```php
class MyMarkingStore implements MarkingStoreInterface
{
public function setMarking($subject, Marking $marking)
{
}
}
```

After:
```php
class MyMarkingStore implements MarkingStoreInterface
{
public function setMarking($subject, Marking $marking , array $context = [])
{
}
}
```
3 changes: 2 additions & 1 deletion UPGRADE-5.0.md
Expand Up @@ -84,7 +84,7 @@ Finder

Form
----

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

Yaml
----
Expand Down
Expand Up @@ -37,6 +37,7 @@ public function getMarking($subject);
* Sets a Marking to a subject.
*
* @param object $subject A subject
* @param array $context Some context
*/
public function setMarking($subject, Marking $marking, array $context = []);
public function setMarking($subject, Marking $marking /*, array $context = []*/);
}
Expand Up @@ -46,7 +46,7 @@ public function getMarking($subject)
/**
* {@inheritdoc}
*/
public function setMarking($subject, Marking $marking, array $context = [])
public function setMarking($subject, Marking $marking)
{
$this->propertyAccessor->setValue($subject, $this->property, $marking->getPlaces());
}
Expand Down
Expand Up @@ -51,7 +51,7 @@ public function getMarking($subject)
/**
* {@inheritdoc}
*/
public function setMarking($subject, Marking $marking, array $context = [])
public function setMarking($subject, Marking $marking)
{
$this->propertyAccessor->setValue($subject, $this->property, key($marking->getPlaces()));
}
Expand Down

0 comments on commit ccd4b18

Please sign in to comment.