-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Workflow] Introduce concept of SupportStrategyInterface #21334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; | ||
|
||
$container->loadFromExtension('framework', array( | ||
'workflows' => array( | ||
'my_workflow' => array( | ||
'marking_store' => array( | ||
'type' => 'multiple_state', | ||
), | ||
'supports' => array( | ||
FrameworkExtensionTest::class, | ||
), | ||
'support_strategy' => 'foobar', | ||
'places' => array( | ||
'first', | ||
'last', | ||
), | ||
'transitions' => array( | ||
'go' => array( | ||
'from' => array( | ||
'first', | ||
), | ||
'to' => array( | ||
'last', | ||
), | ||
), | ||
), | ||
), | ||
), | ||
)); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest; | ||
|
||
$container->loadFromExtension('framework', array( | ||
'workflows' => array( | ||
'my_workflow' => array( | ||
'marking_store' => array( | ||
'type' => 'multiple_state', | ||
), | ||
'places' => array( | ||
'first', | ||
'last', | ||
), | ||
'transitions' => array( | ||
'go' => array( | ||
'from' => array( | ||
'first', | ||
), | ||
'to' => array( | ||
'last', | ||
), | ||
), | ||
), | ||
), | ||
), | ||
)); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:framework="http://symfony.com/schema/dic/symfony" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
|
||
<framework:config> | ||
<framework:workflow name="my_workflow" support-strategy="foobar"> | ||
<framework:marking-store type="multiple_state"/> | ||
<framework:support>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest</framework:support> | ||
<framework:place>first</framework:place> | ||
<framework:place>last</framework:place> | ||
<framework:transition name="foobar"> | ||
<framework:from>a</framework:from> | ||
<framework:to>a</framework:to> | ||
</framework:transition> | ||
</framework:workflow> | ||
</framework:config> | ||
</container> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:framework="http://symfony.com/schema/dic/symfony" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd | ||
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> | ||
|
||
<framework:config> | ||
<framework:workflow name="my_workflow"> | ||
<framework:marking-store type="multiple_state"/> | ||
<framework:place>first</framework:place> | ||
<framework:place>last</framework:place> | ||
<framework:transition name="foobar"> | ||
<framework:from>a</framework:from> | ||
<framework:to>a</framework:to> | ||
</framework:transition> | ||
</framework:workflow> | ||
</framework:config> | ||
</container> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
framework: | ||
workflows: | ||
my_workflow: | ||
marking_store: | ||
type: multiple_state | ||
supports: | ||
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest | ||
support_strategy: foobar | ||
places: | ||
- first | ||
- last | ||
transitions: | ||
go: | ||
from: | ||
- first | ||
to: | ||
- last |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
framework: | ||
workflows: | ||
my_workflow: | ||
marking_store: | ||
type: multiple_state | ||
places: | ||
- first | ||
- last | ||
transitions: | ||
go: | ||
from: | ||
- first | ||
to: | ||
- last |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
CHANGELOG | ||
========= | ||
|
||
3.3.0 | ||
----- | ||
|
||
* Deprecated class name support in `WorkflowRegistry::add()` as second parameter. | ||
Wrap the class name in an instance of ClassInstanceSupportStrategy instead. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should probably mention the new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this should be added to the docs instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong to me in case you are using the
supports
option.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1/ cannotBeEmpty != required
2/ I have added tests on it ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, you're right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lyrixx this forbids resetting it to null in a subsequent config file though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw your comment in the previous PR. But I don't see a valid use case here.