Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 858fabb

Browse filesBrowse files
[Workflow] "clear()" instead of "reset()"
1 parent 00ca74e commit 858fabb
Copy full SHA for 858fabb

File tree

6 files changed

+20
-5
lines changed
Filter options

6 files changed

+20
-5
lines changed

‎UPGRADE-4.1.md

Copy file name to clipboardExpand all lines: UPGRADE-4.1.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ Validator
154154
Workflow
155155
--------
156156

157+
* Deprecated the `DefinitionBuilder::reset()` method, use the `clear()` one instead.
157158
* Deprecated the `add` method in favor of the `addWorkflow` method in `Workflow\Registry`.
158159
* Deprecated `SupportStrategyInterface` in favor of `WorkflowSupportStrategyInterface`.
159160
* Deprecated the class `ClassInstanceSupportStrategy` in favor of the class `InstanceOfSupportStrategy`.

‎UPGRADE-5.0.md

Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Validator
107107
Workflow
108108
--------
109109

110+
* The `DefinitionBuilder::reset()` method has been removed, use the `clear()` one instead.
110111
* `add` method has been removed use `addWorkflow` method in `Workflow\Registry` instead.
111112
* `SupportStrategyInterface` has been removed, use `WorkflowSupportStrategyInterface` instead.
112113
* `ClassInstanceSupportStrategy` has been removed, use `InstanceOfSupportStrategy` instead.

‎src/Symfony/Component/Workflow/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/CHANGELOG.md
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ CHANGELOG
44
4.1.0
55
-----
66

7-
* Deprecate the usage of `add(Workflow $workflow, $supportStrategy)` in `Workflow/Registry`, use `addWorkflow(WorkflowInterface, $supportStrategy)` instead.
8-
* Deprecate the usage of `SupportStrategyInterface`, use `WorkflowSupportStrategyInterface` instead.
7+
* Deprecated the `DefinitionBuilder::reset()` method, use the `clear()` one instead.
8+
* Deprecated the usage of `add(Workflow $workflow, $supportStrategy)` in `Workflow/Registry`, use `addWorkflow(WorkflowInterface, $supportStrategy)` instead.
9+
* Deprecated the usage of `SupportStrategyInterface`, use `WorkflowSupportStrategyInterface` instead.
910
* The `Workflow` class now implements `WorkflowInterface`.
1011
* Deprecated the class `ClassInstanceSupportStrategy` in favor of the class `InstanceOfSupportStrategy`.
1112
* Added TransitionBlockers as a way to pass around reasons why exactly

‎src/Symfony/Component/Workflow/DefinitionBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/DefinitionBuilder.php
+13-1Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function build()
4747
*
4848
* @return $this
4949
*/
50-
public function reset()
50+
public function clear()
5151
{
5252
$this->places = array();
5353
$this->transitions = array();
@@ -121,4 +121,16 @@ public function addTransition(Transition $transition)
121121

122122
return $this;
123123
}
124+
125+
/**
126+
* @deprecated since Symfony 4.1, use the clear() method instead.
127+
*
128+
* @return $this
129+
*/
130+
public function reset()
131+
{
132+
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.1, use the "clear()" method instead.', __METHOD__), E_USER_DEPRECATED);
133+
134+
return $this->clear();
135+
}
124136
}

‎src/Symfony/Component/Workflow/Event/GuardEvent.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/Event/GuardEvent.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function isBlocked()
4242
public function setBlocked($blocked)
4343
{
4444
if (!$blocked) {
45-
$this->transitionBlockerList->reset();
45+
$this->transitionBlockerList->clear();
4646

4747
return;
4848
}

‎src/Symfony/Component/Workflow/TransitionBlockerList.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/TransitionBlockerList.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function add(TransitionBlocker $blocker): void
3737
$this->blockers[] = $blocker;
3838
}
3939

40-
public function reset(): void
40+
public function clear(): void
4141
{
4242
$this->blockers = array();
4343
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.