[Routing] µtweaks
This commit is contained in:
parent
966989a2b9
commit
a21c1127dc
@ -67,7 +67,7 @@ abstract class ObjectRouteLoader extends Loader
|
|||||||
if (!$routeCollection instanceof RouteCollection) {
|
if (!$routeCollection instanceof RouteCollection) {
|
||||||
$type = \is_object($routeCollection) ? \get_class($routeCollection) : \gettype($routeCollection);
|
$type = \is_object($routeCollection) ? \get_class($routeCollection) : \gettype($routeCollection);
|
||||||
|
|
||||||
throw new \LogicException(sprintf('The "%s"::%s method must return a RouteCollection: "%s" returned.', \get_class($loaderObject), $method, $type));
|
throw new \LogicException(sprintf('The "%s::%s()" method must return a RouteCollection: "%s" returned.', \get_class($loaderObject), $method, $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the service file tracked so that if it changes, the cache rebuilds
|
// make the service file tracked so that if it changes, the cache rebuilds
|
||||||
|
@ -240,9 +240,9 @@ class XmlFileLoader extends FileLoader
|
|||||||
|
|
||||||
if ($controller = $node->getAttribute('controller')) {
|
if ($controller = $node->getAttribute('controller')) {
|
||||||
if (isset($defaults['_controller'])) {
|
if (isset($defaults['_controller'])) {
|
||||||
$name = $node->hasAttribute('id') ? sprintf('"%s"', $node->getAttribute('id')) : sprintf('the "%s" tag', $node->tagName);
|
$name = $node->hasAttribute('id') ? sprintf('"%s".', $node->getAttribute('id')) : sprintf('the "%s" tag.', $node->tagName);
|
||||||
|
|
||||||
throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "controller" attribute and the defaults key "_controller" for %s.', $path, $name));
|
throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "controller" attribute and the defaults key "_controller" for ', $path).$name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$defaults['_controller'] = $controller;
|
$defaults['_controller'] = $controller;
|
||||||
|
Reference in New Issue
Block a user