Skip to content

Commit 769496a

Browse files
committed
[Workflow] streamline XML schema definition
1 parent a783412 commit 769496a

File tree

3 files changed

+16
-26
lines changed

3 files changed

+16
-26
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode)
231231
private function addWorkflowSection(ArrayNodeDefinition $rootNode)
232232
{
233233
$rootNode
234-
->fixXmlConfig('workflow')
235234
->children()
236235
->arrayNode('workflows')
237236
->useAttributeAsKey('name')

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

+6-12
Original file line numberDiff line numberDiff line change
@@ -237,25 +237,19 @@
237237
<xsd:complexType name="workflow">
238238
<xsd:sequence>
239239
<xsd:element name="marking-store" type="marking_store" />
240-
<xsd:element name="supports" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
241-
<xsd:element name="places" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
242-
<xsd:element name="transitions" type="transitions" />
240+
<xsd:element name="support" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
241+
<xsd:element name="place" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
242+
<xsd:element name="transition" type="transition" minOccurs="1" maxOccurs="unbounded" />
243243
</xsd:sequence>
244244
<xsd:attribute name="name" type="xsd:string" />
245245
</xsd:complexType>
246246

247247
<xsd:complexType name="marking_store">
248248
<xsd:sequence>
249-
<xsd:element name="type" type="xsd:string" minOccurs="0" maxOccurs="1" />
250-
<xsd:element name="arguments" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
251-
<xsd:element name="service" type="xsd:string" minOccurs="0" maxOccurs="1" />
252-
</xsd:sequence>
253-
</xsd:complexType>
254-
255-
<xsd:complexType name="transitions">
256-
<xsd:sequence>
257-
<xsd:element name="transition" type="transition" />
249+
<xsd:element name="argument" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
258250
</xsd:sequence>
251+
<xsd:attribute name="type" type="xsd:string" use="optional" />
252+
<xsd:attribute name="service" type="xsd:string" use="optional" />
259253
</xsd:complexType>
260254

261255
<xsd:complexType name="transition">

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflow.xml

+10-13
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@
99
<framework:config>
1010
<framework:workflows>
1111
<framework:workflow name="my_workflow">
12-
<framework:marking-store>
13-
<framework:type>multiple_state</framework:type>
14-
<framework:arguments>a</framework:arguments>
15-
<framework:arguments>a</framework:arguments>
12+
<framework:marking-store type="multiple_state">
13+
<framework:argument>a</framework:argument>
14+
<framework:argument>a</framework:argument>
1615
</framework:marking-store>
17-
<framework:supports>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest</framework:supports>
18-
<framework:places>first</framework:places>
19-
<framework:places>last</framework:places>
20-
<framework:transitions>
21-
<framework:transition name="foobar">
22-
<framework:from>a</framework:from>
23-
<framework:to>a</framework:to>
24-
</framework:transition>
25-
</framework:transitions>
16+
<framework:support>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest</framework:support>
17+
<framework:place>first</framework:place>
18+
<framework:place>last</framework:place>
19+
<framework:transition name="foobar">
20+
<framework:from>a</framework:from>
21+
<framework:to>a</framework:to>
22+
</framework:transition>
2623
</framework:workflow>
2724
</framework:workflows>
2825
</framework:config>

0 commit comments

Comments
 (0)