[Workflow] Fixed BC break with MarkingStoreInterface::setMarking()
This commit is contained in:
parent
29f81b003f
commit
7a94e5eaba
@ -116,3 +116,28 @@ Yaml
|
|||||||
----
|
----
|
||||||
|
|
||||||
* Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0.
|
* 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 = [])
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
@ -352,6 +352,7 @@ Workflow
|
|||||||
* `add` method has been removed use `addWorkflow` method in `Workflow\Registry` instead.
|
* `add` method has been removed use `addWorkflow` method in `Workflow\Registry` instead.
|
||||||
* `SupportStrategyInterface` has been removed, use `WorkflowSupportStrategyInterface` instead.
|
* `SupportStrategyInterface` has been removed, use `WorkflowSupportStrategyInterface` instead.
|
||||||
* `ClassInstanceSupportStrategy` has been removed, use `InstanceOfSupportStrategy` instead.
|
* `ClassInstanceSupportStrategy` has been removed, use `InstanceOfSupportStrategy` instead.
|
||||||
|
* `MarkingStoreInterface::setMarking()` has a third argument: `array $context = []`.
|
||||||
|
|
||||||
Yaml
|
Yaml
|
||||||
----
|
----
|
||||||
|
@ -37,6 +37,7 @@ interface MarkingStoreInterface
|
|||||||
* Sets a Marking to a subject.
|
* Sets a Marking to a subject.
|
||||||
*
|
*
|
||||||
* @param object $subject 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 = []*/);
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,10 @@ class MultipleStateMarkingStore implements MarkingStoreInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@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());
|
$this->propertyAccessor->setValue($subject, $this->property, $marking->getPlaces());
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,10 @@ class SingleStateMarkingStore implements MarkingStoreInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@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()));
|
$this->propertyAccessor->setValue($subject, $this->property, key($marking->getPlaces()));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user