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

Appearance settings

Commit 96fb922

Browse filesBrowse files
committed
bug #9197 [FrameworkBundle] updated XML route description (jfsimon)
This PR was merged into the master branch. Discussion ---------- [FrameworkBundle] updated XML route description This PR turns ```xml <route name="route_1" path="/hello/{name}" class="Symfony\Component\Routing\Route" path_regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s"> ``` into ```xml <route name="route_1" class="Symfony\Component\Routing\Route"> <path regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">/hello/{name}</path> ``` in XML routing description. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | #7887 | License | MIT | Doc PR | n/a Commits ------- 7b99ede [FrameworkBundle] updated XML route description
2 parents 4b094e2 + 7b99ede commit 96fb922
Copy full SHA for 96fb922

File tree

Expand file treeCollapse file tree

4 files changed

+12
-6
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+12
-6
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ private function getRouteDocument(Route $route, $name = null)
128128
$routeXML->setAttribute('name', $name);
129129
}
130130

131-
$routeXML->setAttribute('path', $route->getPath());
132131
$routeXML->setAttribute('class', get_class($route));
133-
$routeXML->setAttribute('path_regex', $route->compile()->getRegex());
132+
133+
$routeXML->appendChild($pathXML = $dom->createElement('path'));
134+
$pathXML->setAttribute('regex', $route->compile()->getRegex());
135+
$pathXML->appendChild(new \DOMText($route->getPath()));
134136

135137
if ('' !== $route->getHost()) {
136138
$routeXML->appendChild($hostXML = $dom->createElement('host'));

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.xml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<route path="/hello/{name}" class="Symfony\Component\Routing\Route" path_regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">
2+
<route class="Symfony\Component\Routing\Route">
3+
<path regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">/hello/{name}</path>
34
<host regex="#^localhost$#s">localhost</host>
45
<scheme>http</scheme>
56
<scheme>https</scheme>

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.xml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<route path="/name/add" class="Symfony\Component\Routing\Route" path_regex="#^/name/add$#s">
2+
<route class="Symfony\Component\Routing\Route">
3+
<path regex="#^/name/add$#s">/name/add</path>
34
<host regex="#^localhost$#s">localhost</host>
45
<scheme>http</scheme>
56
<scheme>https</scheme>

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.xml
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<routes>
3-
<route name="route_1" path="/hello/{name}" class="Symfony\Component\Routing\Route" path_regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">
3+
<route name="route_1" class="Symfony\Component\Routing\Route">
4+
<path regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">/hello/{name}</path>
45
<host regex="#^localhost$#s">localhost</host>
56
<scheme>http</scheme>
67
<scheme>https</scheme>
@@ -18,7 +19,8 @@
1819
<option key="opt2">val2</option>
1920
</options>
2021
</route>
21-
<route name="route_2" path="/name/add" class="Symfony\Component\Routing\Route" path_regex="#^/name/add$#s">
22+
<route name="route_2" class="Symfony\Component\Routing\Route">
23+
<path regex="#^/name/add$#s">/name/add</path>
2224
<host regex="#^localhost$#s">localhost</host>
2325
<scheme>http</scheme>
2426
<scheme>https</scheme>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.