8000 [Routing] remove deprecations for 3.0 by Tobion · Pull Request #13396 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] remove deprecations for 3.0 #13396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 31, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FrameworkBundle] remove deprecated routing features
  • Loading branch information
Tobion committed Jan 16, 2015
commit 4ca9ab38e9eb74a9d48853db29e31b63203ae938
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@ private function writeData(array $data, array $options)
*/
protected function getRouteData(Route $route)
{
$requirements = $route->getRequirements();
unset($requirements['_scheme'], $requirements['_method']);

return array(
'path' => $route->getPath(),
'pathRegex' => $route->compile()->getRegex(),
Expand All @@ -192,7 +189,7 @@ protected function getRouteData(Route $route)
'method' => $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY',
'class' => get_class($route),
'defaults' => $route->getDefaults(),
'requirements' => $requirements ?: 'NO CUSTOM',
'requirements' => $route->getRequirements() ?: 'NO CUSTOM',
'options' => $route->getOptions(),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
*/
protected function describeRoute(Route $route, array $options = array())
{
$requirements = $route->getRequirements();
unset($requirements['_scheme'], $requirements['_method']);

$output = '- Path: '.$route->getPath()
."\n".'- Path Regex: '.$route->compile()->getRegex()
."\n".'- Host: '.('' !== $route->getHost() ? $route->getHost() : 'ANY')
Expand All @@ -60,7 +57,7 @@ protected function describeRoute(Route $route, array $options = array())
."\n".'- Method: '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')
."\n".'- Class: '.get_class($route)
."\n".'- Defaults: '.$this->formatRouterConfig($route->getDefaults())
."\n".'- Requirements: '.($requirements ? $this->formatRouterConfig($requirements) : 'NO CUSTOM')
."\n".'- Requirements: '.($route->getRequirements() ? $this->formatRouterConfig($route->getRequirements()) : 'NO CUSTOM')
."\n".'- Options: '.$this->formatRouterConfig($route->getOptions());

$this->write(isset($options['name'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
*/
protected function describeRoute(Route $route, array $options = array())
{
$requirements = $route->getRequirements();
unset($requirements['_scheme'], $requirements['_method']);

// fixme: values were originally written as raw
$description = array(
'<comment>Path</comment> '.$route->getPath(),
Expand All @@ -83,7 +80,7 @@ protected function describeRoute(Route $route, array $options = array())
'<comment>Method</comment> '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'),
'<comment>Class</comment> '.get_class($route),
'<comment>Defaults</comment> '.$this->formatRouterConfig($route->getDefaults()),
'<comment>Requirements</comment> '.($requirements ? $this->formatRouterConfig($requirements) : 'NO CUSTOM'),
'<comment>Requirements</comment> '.($route->getRequirements() ? $this->formatRouterConfig($route->getRequirements()) : 'NO CUSTOM'),
'<comment>Options</comment> '.$this->formatRouterConfig($route->getOptions()),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,9 @@ private function getRouteDocument(Route $route, $name = null)
}
}

$requirements = $route->getRequirements();
unset($requirements['_scheme'], $requirements['_method']);
if (count($requirements)) {
if (count($route->getRequirements())) {
$routeXML->appendChild($requirementsXML = $dom->createElement('requirements'));
foreach ($requirements as $attribute => $pattern) {
foreach ($route->getRequirements() as $attribute => $pattern) {
$requirementsXML->appendChild($requirementXML = $dom->createElement('requirement'));
$requirementXML->setAttribute('key', $attribute);
$requirementXML->appendChild(new \DOMText($pattern));
Expand Down
4 changes: 0 additions & 4 deletions src/Symfony/Bundle/FrameworkBundle/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ private function resolveParameters(RouteCollection $collection)
}

foreach ($route->getRequirements() as $name => $value) {
if ('_scheme' === $name || '_method' === $name) {
continue; // ignore deprecated requirements to not trigger deprecation warnings
}

$route->setRequirement($name, $this->resolve($value));
}

Expand Down
0