From 7a94e5eababe14b9adf706b4654e37c5a327f8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Tue, 12 Mar 2019 10:26:19 +0100 Subject: [PATCH] [Workflow] Fixed BC break with `MarkingStoreInterface::setMarking()` --- UPGRADE-4.3.md | 25 +++++++++++++++++++ UPGRADE-5.0.md | 3 ++- .../MarkingStore/MarkingStoreInterface.php | 3 ++- .../MultipleStateMarkingStore.php | 4 ++- .../MarkingStore/SingleStateMarkingStore.php | 4 ++- 5 files changed, 35 insertions(+), 4 deletions(-) diff --git a/UPGRADE-4.3.md b/UPGRADE-4.3.md index a6a4d2e307..36c52acfdc 100644 --- a/UPGRADE-4.3.md +++ b/UPGRADE-4.3.md @@ -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 = []) + { + } + } + ``` diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 1805e312e4..02f588d06a 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -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 @@ -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 ---- diff --git a/src/Symfony/Component/Workflow/MarkingStore/MarkingStoreInterface.php b/src/Symfony/Component/Workflow/MarkingStore/MarkingStoreInterface.php index 991a2fc0bd..a932f99c8b 100644 --- a/src/Symfony/Component/Workflow/MarkingStore/MarkingStoreInterface.php +++ b/src/Symfony/Component/Workflow/MarkingStore/MarkingStoreInterface.php @@ -37,6 +37,7 @@ interface MarkingStoreInterface * 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 = []*/); } diff --git a/src/Symfony/Component/Workflow/MarkingStore/MultipleStateMarkingStore.php b/src/Symfony/Component/Workflow/MarkingStore/MultipleStateMarkingStore.php index 9e70614e02..db6b03b30a 100644 --- a/src/Symfony/Component/Workflow/MarkingStore/MultipleStateMarkingStore.php +++ b/src/Symfony/Component/Workflow/MarkingStore/MultipleStateMarkingStore.php @@ -45,8 +45,10 @@ class MultipleStateMarkingStore implements MarkingStoreInterface /** * {@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()); } diff --git a/src/Symfony/Component/Workflow/MarkingStore/SingleStateMarkingStore.php b/src/Symfony/Component/Workflow/MarkingStore/SingleStateMarkingStore.php index ca28017384..41da9b49b9 100644 --- a/src/Symfony/Component/Workflow/MarkingStore/SingleStateMarkingStore.php +++ b/src/Symfony/Component/Workflow/MarkingStore/SingleStateMarkingStore.php @@ -50,8 +50,10 @@ class SingleStateMarkingStore implements MarkingStoreInterface /** * {@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())); }