Permalink
Browse files

Worsen XML structure

  • Loading branch information...
1 parent 7067ca9 commit 3930be77d0f32017483270b0f917923dfcaabafc @lstrojny lstrojny committed Aug 29, 2012
View
6 DependencyInjection/Configuration.php
@@ -84,13 +84,9 @@ public function getConfigTreeBuilder()
->end()
->scalarNode('delivery_address')->end()
->end()
- ->fixXmlConfig('pattern', 'delivery_whitelist')
+ ->fixXmlConfig('delivery_whitelist_pattern', 'delivery_whitelist')
->children()
->arrayNode('delivery_whitelist')
- ->beforeNormalization()
- ->ifTrue(function($v) {return isset($v['pattern']) && is_array($v['pattern']);})
- ->then(function($v) {return $v['pattern'];})
- ->end()
->prototype('scalar')
->end()
->end()
View
14 Resources/config/schema/swiftmailer-1.0.xsd
@@ -8,11 +8,11 @@
<xsd:element name="config" type="config" />
<xsd:complexType name="config">
- <xsd:all>
- <xsd:element name="delivery-whitelist" type="delivery_whitelist" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="spool" type="spool" minOccurs="0" maxOccurs="1" />
+ <xsd:sequence>
<xsd:element name="antiflood" type="antiflood" minOccurs="0" maxOccurs="1" />
- </xsd:all>
+ <xsd:element name="spool" type="spool" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="delivery-whitelist-pattern" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
<xsd:attribute name="username" type="xsd:string" />
<xsd:attribute name="password" type="xsd:string" />
@@ -63,10 +63,4 @@
<xsd:enumeration value="none" />
</xsd:restriction>
</xsd:simpleType>
-
- <xsd:complexType name="delivery_whitelist">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="pattern" type="xsd:string"/>
- </xsd:choice>
- </xsd:complexType>
</xsd:schema>
View
6 Tests/DependencyInjection/Fixtures/config/xml/full.xml
@@ -19,9 +19,7 @@
delivery-address="single@host.com">
<swiftmailer:antiflood/>
<swiftmailer:spool type="memory"/>
- <swiftmailer:delivery-whitelist>
- <swiftmailer:pattern>/foo@.*/</swiftmailer:pattern>
- <swiftmailer:pattern>/.*@bar.com$/</swiftmailer:pattern>
- </swiftmailer:delivery-whitelist>
+ <swiftmailer:delivery-whitelist-pattern>/foo@.*/</swiftmailer:delivery-whitelist-pattern>
+ <swiftmailer:delivery-whitelist-pattern>/.*@bar.com$/</swiftmailer:delivery-whitelist-pattern>
</swiftmailer:config>
</container>
View
6 Tests/DependencyInjection/Fixtures/config/xml/redirect.xml
@@ -6,9 +6,7 @@
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<swiftmailer:config delivery-address="single@host.com">
- <swiftmailer:delivery-whitelist>
- <swiftmailer:pattern>/foo@.*/</swiftmailer:pattern>
- <swiftmailer:pattern>/.*@bar.com$/</swiftmailer:pattern>
- </swiftmailer:delivery-whitelist>
+ <swiftmailer:delivery-whitelist-pattern>/foo@.*/</swiftmailer:delivery-whitelist-pattern>
+ <swiftmailer:delivery-whitelist-pattern>/.*@bar.com$/</swiftmailer:delivery-whitelist-pattern>
</swiftmailer:config>
</container>
View
4 Tests/DependencyInjection/Fixtures/config/xml/redirect_single.xml
@@ -6,8 +6,6 @@
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<swiftmailer:config delivery-address="single@host.com">
- <swiftmailer:delivery-whitelist>
- <swiftmailer:pattern>/foo@.*/</swiftmailer:pattern>
- </swiftmailer:delivery-whitelist>
+ <swiftmailer:delivery-whitelist-pattern>/foo@.*/</swiftmailer:delivery-whitelist-pattern>
</swiftmailer:config>
</container>

0 comments on commit 3930be7

Please sign in to comment.