Make NullGenerator fail gracefully, since we can't yet avoid it being called at all.
parent
99e068c486
commit
ed9c2a50f5
|
@ -8,6 +8,7 @@
|
|||
namespace Drupal\Core\Routing;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
|
||||
/**
|
||||
* No-op implementation of a Url Generator, needed for backward compatibility.
|
||||
|
@ -15,14 +16,13 @@ use Symfony\Component\Routing\RequestContext;
|
|||
class NullGenerator implements UrlGeneratorInterface {
|
||||
|
||||
public function generate($name, $parameters = array(), $absolute = FALSE) {
|
||||
throw new \Exception('Method disabled. This is a dummy implementation.');
|
||||
return '';
|
||||
throw new RouteNotFoundException();
|
||||
}
|
||||
|
||||
public function setContext(RequestContext $context) {
|
||||
throw new \Exception('Method disabled. This is a dummy implementation.');
|
||||
}
|
||||
|
||||
public function getContext() {
|
||||
throw new \Exception('Method disabled. This is a dummy implementation.');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue