Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #9489 [DependencyInjection] Add normalization to tag options (Wou…
…terJ) This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #9489). Discussion ---------- [DependencyInjection] Add normalization to tag options Currently, when using tags in XML, the options aren't normalized. This means that the following code is wrong: <tag name="sonata_admin" manager-type="doctrine_phpcr" ... /> It should be `manager_name` to remove errors, but that's not following the XML rules. The solution is to use the same normalization as the configuration: replacing - with _. To be BC, both options (with and without normalization) are kept | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 06d64d8 Do normalization on tag options
- Loading branch information
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services10.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
<service id="foo" class="BarClass"> | ||
<tag name="foo_tag" | ||
some-option="cat" | ||
some_option="ciz" | ||
other-option="lorem" | ||
an_other-option="ipsum" | ||
/> | ||
</service> | ||
</services> | ||
</container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
<service id="foo" class="BarClass" /> | ||
</services> | ||
</container> |