[Workflow] Fixed BC break on WorkflowInterface
This commit is contained in:
parent
766162c4c7
commit
1eb10b996a
@ -242,6 +242,28 @@ Workflow
|
||||
initial_marking: [draft]
|
||||
```
|
||||
|
||||
* `WorkflowInterface::apply()` will have a third argument in Symfony 5.0.
|
||||
|
||||
Before:
|
||||
```php
|
||||
class MyWorkflow implements WorkflowInterface
|
||||
{
|
||||
public function apply($subject, $transitionName)
|
||||
{
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After:
|
||||
```php
|
||||
class MyWorkflow implements WorkflowInterface
|
||||
{
|
||||
public function apply($subject, $transitionName, array $context = [])
|
||||
{
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
* `MarkingStoreInterface::setMarking()` will have a third argument in Symfony 5.0.
|
||||
|
||||
Before:
|
||||
|
@ -414,6 +414,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.
|
||||
* `WorkflowInterface::apply()` has a third argument: `array $context = []`.
|
||||
* `MarkingStoreInterface::setMarking()` has a third argument: `array $context = []`.
|
||||
* Removed support of `initial_place`. Use `initial_places` instead.
|
||||
* `MultipleStateMarkingStore` has been removed. Use `MethodMarkingStore` instead.
|
||||
|
@ -39,5 +39,5 @@ interface MarkingStoreInterface
|
||||
* @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 = []*/);
|
||||
}
|
||||
|
@ -150,9 +150,13 @@ class Workflow implements WorkflowInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param array $context Some context
|
||||
*/
|
||||
public function apply($subject, $transitionName, array $context = [])
|
||||
public function apply($subject, $transitionName/*, array $context = []*/)
|
||||
{
|
||||
$context = \func_get_args()[2] ?? [];
|
||||
|
||||
$marking = $this->getMarking($subject);
|
||||
|
||||
$transitionBlockerList = null;
|
||||
|
@ -53,12 +53,13 @@ interface WorkflowInterface
|
||||
*
|
||||
* @param object $subject A subject
|
||||
* @param string $transitionName A transition
|
||||
* @param array $context Some context
|
||||
*
|
||||
* @return Marking The new Marking
|
||||
*
|
||||
* @throws LogicException If the transition is not applicable
|
||||
*/
|
||||
public function apply($subject, $transitionName, array $context = []);
|
||||
public function apply($subject, $transitionName/*, array $context = []*/);
|
||||
|
||||
/**
|
||||
* Returns all enabled transitions.
|
||||
|
Reference in New Issue
Block a user