[FrameworkBundle] remove deprecated routing features
This commit is contained in:
parent
86278cd6c0
commit
4ca9ab38e9
@ -180,9 +180,6 @@ class JsonDescriptor extends Descriptor
|
|||||||
*/
|
*/
|
||||||
protected function getRouteData(Route $route)
|
protected function getRouteData(Route $route)
|
||||||
{
|
{
|
||||||
$requirements = $route->getRequirements();
|
|
||||||
unset($requirements['_scheme'], $requirements['_method']);
|
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'path' => $route->getPath(),
|
'path' => $route->getPath(),
|
||||||
'pathRegex' => $route->compile()->getRegex(),
|
'pathRegex' => $route->compile()->getRegex(),
|
||||||
@ -192,7 +189,7 @@ class JsonDescriptor extends Descriptor
|
|||||||
'method' => $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY',
|
'method' => $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY',
|
||||||
'class' => get_class($route),
|
'class' => get_class($route),
|
||||||
'defaults' => $route->getDefaults(),
|
'defaults' => $route->getDefaults(),
|
||||||
'requirements' => $requirements ?: 'NO CUSTOM',
|
'requirements' => $route->getRequirements() ?: 'NO CUSTOM',
|
||||||
'options' => $route->getOptions(),
|
'options' => $route->getOptions(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -49,9 +49,6 @@ class MarkdownDescriptor extends Descriptor
|
|||||||
*/
|
*/
|
||||||
protected function describeRoute(Route $route, array $options = array())
|
protected function describeRoute(Route $route, array $options = array())
|
||||||
{
|
{
|
||||||
$requirements = $route->getRequirements();
|
|
||||||
unset($requirements['_scheme'], $requirements['_method']);
|
|
||||||
|
|
||||||
$output = '- Path: '.$route->getPath()
|
$output = '- Path: '.$route->getPath()
|
||||||
."\n".'- Path Regex: '.$route->compile()->getRegex()
|
."\n".'- Path Regex: '.$route->compile()->getRegex()
|
||||||
."\n".'- Host: '.('' !== $route->getHost() ? $route->getHost() : 'ANY')
|
."\n".'- Host: '.('' !== $route->getHost() ? $route->getHost() : 'ANY')
|
||||||
@ -60,7 +57,7 @@ class MarkdownDescriptor extends Descriptor
|
|||||||
."\n".'- Method: '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')
|
."\n".'- Method: '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')
|
||||||
."\n".'- Class: '.get_class($route)
|
."\n".'- Class: '.get_class($route)
|
||||||
."\n".'- Defaults: '.$this->formatRouterConfig($route->getDefaults())
|
."\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());
|
."\n".'- Options: '.$this->formatRouterConfig($route->getOptions());
|
||||||
|
|
||||||
$this->write(isset($options['name'])
|
$this->write(isset($options['name'])
|
||||||
|
@ -70,9 +70,6 @@ class TextDescriptor extends Descriptor
|
|||||||
*/
|
*/
|
||||||
protected function describeRoute(Route $route, array $options = array())
|
protected function describeRoute(Route $route, array $options = array())
|
||||||
{
|
{
|
||||||
$requirements = $route->getRequirements();
|
|
||||||
unset($requirements['_scheme'], $requirements['_method']);
|
|
||||||
|
|
||||||
// fixme: values were originally written as raw
|
// fixme: values were originally written as raw
|
||||||
$description = array(
|
$description = array(
|
||||||
'<comment>Path</comment> '.$route->getPath(),
|
'<comment>Path</comment> '.$route->getPath(),
|
||||||
@ -83,7 +80,7 @@ class TextDescriptor extends Descriptor
|
|||||||
'<comment>Method</comment> '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'),
|
'<comment>Method</comment> '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'),
|
||||||
'<comment>Class</comment> '.get_class($route),
|
'<comment>Class</comment> '.get_class($route),
|
||||||
'<comment>Defaults</comment> '.$this->formatRouterConfig($route->getDefaults()),
|
'<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()),
|
'<comment>Options</comment> '.$this->formatRouterConfig($route->getOptions()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -196,11 +196,9 @@ class XmlDescriptor extends Descriptor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$requirements = $route->getRequirements();
|
if (count($route->getRequirements())) {
|
||||||
unset($requirements['_scheme'], $requirements['_method']);
|
|
||||||
if (count($requirements)) {
|
|
||||||
$routeXML->appendChild($requirementsXML = $dom->createElement('requirements'));
|
$routeXML->appendChild($requirementsXML = $dom->createElement('requirements'));
|
||||||
foreach ($requirements as $attribute => $pattern) {
|
foreach ($route->getRequirements() as $attribute => $pattern) {
|
||||||
$requirementsXML->appendChild($requirementXML = $dom->createElement('requirement'));
|
$requirementsXML->appendChild($requirementXML = $dom->createElement('requirement'));
|
||||||
$requirementXML->setAttribute('key', $attribute);
|
$requirementXML->setAttribute('key', $attribute);
|
||||||
$requirementXML->appendChild(new \DOMText($pattern));
|
$requirementXML->appendChild(new \DOMText($pattern));
|
||||||
|
@ -92,10 +92,6 @@ class Router extends BaseRouter implements WarmableInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($route->getRequirements() as $name => $value) {
|
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));
|
$route->setRequirement($name, $this->resolve($value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user