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 a457a04

Browse filesBrowse files
committed
[FrameworkBundle] remove deprecated routing features
1 parent d9d6388 commit a457a04
Copy full SHA for a457a04

File tree

5 files changed

+5
-20
lines changed
Filter options

5 files changed

+5
-20
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ private function writeData(array $data, array $options)
180180
*/
181181
protected function getRouteData(Route $route)
182182
{
183-
$requirements = $route->getRequirements();
184-
unset($requirements['_scheme'], $requirements['_method']);
185-
186183
return array(
187184
'path' => $route->getPath(),
188185
'pathRegex' => $route->compile()->getRegex(),
@@ -192,7 +189,7 @@ protected function getRouteData(Route $route)
192189
'method' => $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY',
193190
'class' => get_class($route),
194191
'defaults' => $route->getDefaults(),
195-
'requirements' => $requirements ?: 'NO CUSTOM',
192+
'requirements' => $route->getRequirements() ?: 'NO CUSTOM',
196193
'options' => $route->getOptions(),
197194
);
198195
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
4949
*/
5050
protected function describeRoute(Route $route, array $options = array())
5151
{
52-
$requirements = $route->getRequirements();
53-
unset($requirements['_scheme'], $requirements['_method']);
54-
5552
$output = '- Path: '.$route->getPath()
5653
."\n".'- Path Regex: '.$route->compile()->getRegex()
5754
."\n".'- Host: '.('' !== $route->getHost() ? $route->getHost() : 'ANY')
@@ -60,7 +57,7 @@ protected function describeRoute(Route $route, array $options = array())
6057
."\n".'- Method: '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')
6158
."\n".'- Class: '.get_class($route)
6259
."\n".'- Defaults: '.$this->formatRouterConfig($route->getDefaults())
63-
."\n".'- Requirements: '.$this->formatRouterConfig($requirements) ?: 'NONE'
60+
."\n".'- Requirements: '.$this->formatRouterConfig($route->getRequirements())
6461
."\n".'- Options: '.$this->formatRouterConfig($route->getOptions());
6562

6663
$this->write(isset($options['name'])

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
7070
*/
7171
protected function describeRoute(Route $route, array $options = array())
7272
{
73-
$requirements = $route->getRequirements();
74-
unset($requirements['_scheme'], $requirements['_method']);
75-
7673
// fixme: values were originally written as raw
7774
$description = array(
7875
'<comment>Path</comment> '.$route->getPath(),
@@ -83,7 +80,7 @@ protected function describeRoute(Route $route, array $options = array())
8380
'<comment>Method</comment> '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'),
8481
'<comment>Class</comment> '.get_class($route),
8582
'<comment>Defaults</comment> '.$this->formatRouterConfig($route->getDefaults()),
86-
'<comment>Requirements</comment> '.$this->formatRouterConfig($requirements) ?: 'NO CUSTOM',
83+
'<comment>Requirements</comment> '.$this->formatRouterConfig($route->getRequirements()) ?: 'NO CUSTOM',
8784
'<comment>Options</comment> '.$this->formatRouterConfig($route->getOptions()),
8885
);
8986

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,9 @@ private function getRouteDocument(Route $route, $name = null)
196196
}
197197
}
198198

199-
$requirements = $route->getRequirements();
200-
unset($requirements['_scheme'], $requirements['_method']);
201-
if (count($requirements)) {
199+
if (count($route->getRequirements())) {
202200
$routeXML->appendChild($requirementsXML = $dom->createElement('requirements'));
203-
foreach ($requirements as $attribute => $pattern) {
201+
foreach ($route->getRequirements() as $attribute => $pattern) {
204202
$requirementsXML->appendChild($requirementXML = $dom->createElement('requirement'));
205203
$requirementXML->setAttribute('key', $attribute);
206204
$requirementXML->appendChild(new \DOMText($pattern));

‎src/Symfony/Bundle/FrameworkBundle/Routing/Router.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Routing/Router.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ private function resolveParameters(RouteCollection $collection)
9292
}
9393

9494
foreach ($route->getRequirements() as $name => $value) {
95-
if ('_scheme' === $name || '_method' === $name) {
96-
continue; // ignore deprecated requirements to not trigger deprecation warnings
97-
}
98-
9995
$route->setRequirement($name, $this->resolve($value));
10096
}
10197

0 commit comments

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