Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit86dbbde

Browse files
feature#22416 [FrameworkBundle][Workflow] Deprecate the default type of a workflow (lyrixx)
This PR was merged into the 3.3-dev branch.Discussion----------[FrameworkBundle][Workflow] Deprecate the default type of a workflow| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | ----Before this patch, the default type is "workflow". Most of the time a"state_machine" is better because it's simpler and it involves lessknowledge to be able to use it.So this patch deprecate a missing type in Symfony 3.3. And In Symfony4.0 the default value will become "state_machine".Commits-------004751c [FrameworkBundle][Workflow] Deprecate the default type of a workflow
2 parents1674f92 +004751c commit86dbbde

File tree

12 files changed

+86
-11
lines changed

12 files changed

+86
-11
lines changed

‎UPGRADE-3.3.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ Form
138138
* Using the "choices" option in``CountryType``,``CurrencyType``,``LanguageType``,
139139
``LocaleType``, and``TimezoneType`` without overriding the``choice_loader``
140140
option has been deprecated and will be ignored in 4.0.
141-
141+
142142
Before:
143143
```php
144144
$builder->add('custom_locales', LocaleType::class, array(
145145
'choices' => $availableLocales,
146146
));
147147
```
148-
148+
149149
After:
150150
```php
151151
$builder->add('custom_locales', LocaleType::class, array(
@@ -168,6 +168,9 @@ FrameworkBundle
168168

169169
* The "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter have been deprecated and will be removed in 4.0. Use the Request::setTrustedProxies() method in your front controller instead.
170170

171+
* Not defining the`type` option of the`framework.workflows.*` configuration entries is deprecated.
172+
The default value will be`state_machine` in Symfony 4.0.
173+
171174
* The`Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CompilerDebugDumpPass` has been deprecated.
172175

173176
* The`Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been deprecated.

‎UPGRADE-4.0.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ Form
198198
* Using the "choices" option in``CountryType``,``CurrencyType``,``LanguageType``,
199199
``LocaleType``, and``TimezoneType`` without overriding the``choice_loader``
200200
option is now ignored.
201-
201+
202202
Before:
203203
```php
204204
$builder->add('custom_locales', LocaleType::class, array(
205205
'choices' => $availableLocales,
206206
));
207207
```
208-
208+
209209
After:
210210
```php
211211
$builder->add('custom_locales', LocaleType::class, array(
@@ -228,6 +228,8 @@ FrameworkBundle
228228

229229
* The "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter have been removed. Use the`Request::setTrustedProxies()` method in your front controller instead.
230230

231+
* The default value of the`framework.workflows.[name].type` configuration options is now`state_machine`.
232+
231233
* Support for absolute template paths has been removed.
232234

233235
* The following form types registered as services have been removed; use their
@@ -415,7 +417,7 @@ Security
415417

416418
* The`RoleInterface` has been removed. Extend the`Symfony\Component\Security\Core\Role\Role`
417419
class instead.
418-
420+
419421
* The`LogoutUrlGenerator::registerListener()` method expects a 6th`$context = null` argument.
420422

421423
* The`AccessDecisionManager::setVoters()` method has been removed. Pass the

‎src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ CHANGELOG
44
3.3.0
55
-----
66

7+
* Not defining the`type` option of the`framework.workflows.*` configuration entries is deprecated.
8+
The default value will be`state_machine` in Symfony 4.0.
79
* Deprecated the`CompilerDebugDumpPass` class
810
*[BC BREAK] Removed the "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter
911
* Added a new new version strategy option called json_manifest_path
@@ -33,13 +35,13 @@ CHANGELOG
3335
* Deprecated`ControllerArgumentValueResolverPass`. Use
3436
`Symfony\Component\HttpKernel\DependencyInjection\ControllerArgumentValueResolverPass` instead
3537
* Deprecated`RoutingResolverPass`, use`Symfony\Component\Routing\DependencyInjection\RoutingResolverPass` instead
36-
*[BC BREAK] The`server:run`,`server:start`,`server:stop` and
37-
`server:status` console commands have been moved to a dedicated bundle.
38-
Require`symfony/web-server-bundle` in your composer.json and register
38+
*[BC BREAK] The`server:run`,`server:start`,`server:stop` and
39+
`server:status` console commands have been moved to a dedicated bundle.
40+
Require`symfony/web-server-bundle` in your composer.json and register
3941
`Symfony\Bundle\WebServerBundle\WebServerBundle` in your AppKernel to use them.
4042
* Added`$defaultLocale` as 3rd argument of`Translator::__construct()`
4143
making`Translator` works with any PSR-11 container
42-
* Added`framework.serializer.mapping` config option allowing to define custom
44+
* Added`framework.serializer.mapping` config option allowing to define custom
4345
serialization mapping files and directories
4446
* Deprecated`AddValidatorInitializersPass`, use
4547
`Symfony\Component\Validator\DependencyInjection\AddValidatorInitializersPass` instead

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
230230
->end()
231231
->enumNode('type')
232232
->values(array('workflow','state_machine'))
233-
->defaultValue('workflow')
234233
->end()
235234
->arrayNode('marking_store')
236235
->fixXmlConfig('argument')

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,10 @@ private function registerWorkflowConfiguration(array $workflows, ContainerBuilde
440440
$registryDefinition =$container->getDefinition('workflow.registry');
441441

442442
foreach ($workflowsas$name =>$workflow) {
443+
if (!array_key_exists('type',$workflow)) {
444+
$workflow['type'] ='workflow';
445+
@trigger_error(sprintf('The "type" option of the "framework.workflows.%s" configuration entry must be defined since Symfony 3.3. The default value will be "state_machine" in Symfony 4.0.',$name),E_USER_DEPRECATED);
446+
}
443447
$type =$workflow['type'];
444448

445449
$transitions =array();

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
),
9090
),
9191
'service_marking_store_workflow' =>array(
92+
'type' =>'workflow',
9293
'marking_store' =>array(
9394
'service' =>'workflow_service',
9495
),
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
useSymfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest;
4+
5+
$container->loadFromExtension('framework',array(
6+
'workflows' =>array(
7+
'missing_type' =>array(
8+
'marking_store' =>array(
9+
'service' =>'workflow_service',
10+
),
11+
'supports' =>array(
12+
\stdClass::class,
13+
),
14+
'places' =>array(
15+
'first',
16+
'last',
17+
),
18+
'transitions' =>array(
19+
'go' =>array(
20+
'from' =>'first',
21+
'to' =>'last',
22+
),
23+
),
24+
),
25+
),
26+
));

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflows.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
</framework:transition>
8181
</framework:workflow>
8282

83-
<framework:workflowname="service_marking_store_workflow">
83+
<framework:workflowname="service_marking_store_workflow"type="workflow">
8484
<framework:marking-storeservice="workflow_service"/>
8585
<framework:support>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest</framework:support>
8686
<framework:place>first</framework:place>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" ?>
2+
3+
<containerxmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns:framework="http://symfony.com/schema/dic/symfony"
6+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
7+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
8+
9+
<framework:config>
10+
<framework:workflowname="missing_type">
11+
<framework:marking-storeservice="workflow_service"/>
12+
<framework:support>stdClass</framework:support>
13+
<framework:place>first</framework:place>
14+
<framework:place>last</framework:place>
15+
<framework:transitionname="go">
16+
<framework:from>first</framework:from>
17+
<framework:to>last</framework:to>
18+
</framework:transition>
19+
</framework:workflow>
20+
</framework:config>
21+
</container>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ framework:
6464
from:closed
6565
to:review
6666
service_marking_store_workflow:
67+
type:workflow
6768
marking_store:
6869
service:workflow_service
6970
supports:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp