bug #33835 [Workflow] Fixed BC break on WorkflowInterface (lyrixx)
This PR was merged into the 4.3 branch.
Discussion
----------
[Workflow] Fixed BC break on WorkflowInterface
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
1eb10b996a
[Workflow] Fixed BC break on WorkflowInterface
This commit is contained in:
commit
abe2745b15
@ -242,6 +242,28 @@ Workflow
|
|||||||
initial_marking: [draft]
|
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.
|
* `MarkingStoreInterface::setMarking()` will have a third argument in Symfony 5.0.
|
||||||
|
|
||||||
Before:
|
Before:
|
||||||
|
@ -414,6 +414,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.
|
||||||
|
* `WorkflowInterface::apply()` has a third argument: `array $context = []`.
|
||||||
* `MarkingStoreInterface::setMarking()` has a third argument: `array $context = []`.
|
* `MarkingStoreInterface::setMarking()` has a third argument: `array $context = []`.
|
||||||
* Removed support of `initial_place`. Use `initial_places` instead.
|
* Removed support of `initial_place`. Use `initial_places` instead.
|
||||||
* `MultipleStateMarkingStore` has been removed. Use `MethodMarkingStore` instead.
|
* `MultipleStateMarkingStore` has been removed. Use `MethodMarkingStore` instead.
|
||||||
|
@ -150,9 +150,13 @@ class Workflow implements WorkflowInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@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);
|
$marking = $this->getMarking($subject);
|
||||||
|
|
||||||
$transitionBlockerList = null;
|
$transitionBlockerList = null;
|
||||||
|
@ -53,12 +53,13 @@ interface WorkflowInterface
|
|||||||
*
|
*
|
||||||
* @param object $subject A subject
|
* @param object $subject A subject
|
||||||
* @param string $transitionName A transition
|
* @param string $transitionName A transition
|
||||||
|
* @param array $context Some context
|
||||||
*
|
*
|
||||||
* @return Marking The new Marking
|
* @return Marking The new Marking
|
||||||
*
|
*
|
||||||
* @throws LogicException If the transition is not applicable
|
* @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.
|
* Returns all enabled transitions.
|
||||||
|
Reference in New Issue
Block a user