Skip to content
Permalink
Browse files

[Workflow] Fixed BC break on WorkflowInterface

  • Loading branch information...
lyrixx committed Oct 3, 2019
1 parent 766162c commit 1eb10b996a32b7d45b35a9eaa3fd7c81c78d8cea
@@ -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 @@ public function getMarking($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 = []*/);
}
@@ -150,9 +150,13 @@ public function buildTransitionBlockerList($subject, string $transitionName): Tr
/**
* {@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 @@ public function buildTransitionBlockerList($subject, string $transitionName): Tr
*
* @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.

0 comments on commit 1eb10b9

Please sign in to comment.
You can’t perform that action at this time.