Skip to content

[Workflow] Fixed BC break with MarkingStoreInterface::setMarking() #30530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Workflow] Fixed BC break with MarkingStoreInterface::setMarking()
  • Loading branch information
lyrixx committed Mar 13, 2019
commit 7a94e5eababe14b9adf706b4654e37c5a327f8c6
25 changes: 25 additions & 0 deletions UPGRADE-4.3.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 = []*/);
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ public function getMarking($subject)

/**
* {@inheritdoc}
*
* @param array $context Some context
*/
public function setMarking($subject, Marking $marking, array $context = [])
public function setMarking($subject, Marking $marking/*, array $context = []*/)
{
$this->propertyAccessor->setValue($subject, $this->property, $marking->getPlaces());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public function getMarking($subject)

/**
* {@inheritdoc}
*
* @param array $context Some context
*/
public function setMarking($subject, Marking $marking, array $context = [])
public function setMarking($subject, Marking $marking/*, array $context = []*/)
{
$this->propertyAccessor->setValue($subject, $this->property, key($marking->getPlaces()));
}
Expand Down