Commit 838bf21e authored by webchick's avatar webchick

git commit -m Issue

parent 4165a693
...@@ -448,7 +448,6 @@ function drupal_get_query_parameters(array $query = NULL, array $exclude = array ...@@ -448,7 +448,6 @@ function drupal_get_query_parameters(array $query = NULL, array $exclude = array
/** /**
* Parses an array into a valid, rawurlencoded query string. * Parses an array into a valid, rawurlencoded query string.
* *
* @see \Drupal\Core\Routing\PathBasedGeneratorInterface::httpBuildQuery()
* @see drupal_get_query_parameters() * @see drupal_get_query_parameters()
* @deprecated as of Drupal 8.0. Use Url::buildQuery() instead. * @deprecated as of Drupal 8.0. Use Url::buildQuery() instead.
* @ingroup php_wrappers * @ingroup php_wrappers
...@@ -1192,7 +1191,7 @@ function datetime_default_format_type() { ...@@ -1192,7 +1191,7 @@ function datetime_default_format_type() {
* When creating links in modules, consider whether l() could be a better * When creating links in modules, consider whether l() could be a better
* alternative than url(). * alternative than url().
* *
* @see \Drupal\Core\Routing\PathBasedGeneratorInterface::generateFromPath(). * @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromPath().
*/ */
function url($path = NULL, array $options = array()) { function url($path = NULL, array $options = array()) {
$generator = Drupal::urlGenerator(); $generator = Drupal::urlGenerator();
......
...@@ -364,7 +364,7 @@ public static function token() { ...@@ -364,7 +364,7 @@ public static function token() {
/** /**
* Returns the url generator service. * Returns the url generator service.
* *
* @return \Drupal\Core\Routing\PathBasedGeneratorInterface * @return \Drupal\Core\Routing\UrlGeneratorInterface
* The url generator service. * The url generator service.
*/ */
public static function urlGenerator() { public static function urlGenerator() {
......
...@@ -114,7 +114,7 @@ protected function moduleHandler() { ...@@ -114,7 +114,7 @@ protected function moduleHandler() {
/** /**
* Returns the url generator service. * Returns the url generator service.
* *
* @return \Drupal\Core\Routing\PathBasedGeneratorInterface * @return \Drupal\Core\Routing\UrlGeneratorInterface
* The url generator service. * The url generator service.
*/ */
protected function urlGenerator() { protected function urlGenerator() {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
use Drupal\Core\CacheDecorator\AliasManagerCacheDecorator; use Drupal\Core\CacheDecorator\AliasManagerCacheDecorator;
use Drupal\Core\PathProcessor\InboundPathProcessorInterface; use Drupal\Core\PathProcessor\InboundPathProcessorInterface;
use Drupal\Core\Routing\PathBasedGeneratorInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\GetResponseEvent;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace Drupal\Core\EventSubscriber; namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Routing\PathBasedGeneratorInterface; use Drupal\Core\Routing\UrlGeneratorInterface;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
...@@ -22,17 +22,17 @@ class RedirectResponseSubscriber implements EventSubscriberInterface { ...@@ -22,17 +22,17 @@ class RedirectResponseSubscriber implements EventSubscriberInterface {
/** /**
* The url generator service. * The url generator service.
* *
* @var \Drupal\Core\Routing\PathBasedGeneratorInterface * @var \Drupal\Core\Routing\UrlGeneratorInterface
*/ */
protected $urlGenerator; protected $urlGenerator;
/** /**
* Constructs a RedirectResponseSubscriber object. * Constructs a RedirectResponseSubscriber object.
* *
* @param \Drupal\Core\Routing\PathBasedGeneratorInterface $url_generator * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator
* The url generator service. * The url generator service.
*/ */
public function __construct(PathBasedGeneratorInterface $url_generator) { public function __construct(UrlGeneratorInterface $url_generator) {
$this->urlGenerator = $url_generator; $this->urlGenerator = $url_generator;
} }
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
namespace Drupal\Core\Routing; namespace Drupal\Core\Routing;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Exception\RouteNotFoundException;
...@@ -23,9 +22,12 @@ public function __construct() { ...@@ -23,9 +22,12 @@ public function __construct() {
} }
/** /**
* Overrides Drupal\Core\Routing\UrlGenerator::generate(); * {@inheritdoc}
*
* generate(), generateFromRoute(), and getPathFromRoute() all call this
* protected method.
*/ */
public function generate($name, $parameters = array(), $absolute = FALSE) { protected function getRoute($name) {
throw new RouteNotFoundException(); throw new RouteNotFoundException();
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/** /**
* A Generator creates URL strings based on a specified route. * A Generator creates URL strings based on a specified route.
*/ */
class UrlGenerator extends ProviderBasedGenerator implements PathBasedGeneratorInterface { class UrlGenerator extends ProviderBasedGenerator implements UrlGeneratorInterface {
/** /**
* A request object. * A request object.
...@@ -87,7 +87,7 @@ public function __construct(RouteProviderInterface $provider, OutboundPathProces ...@@ -87,7 +87,7 @@ public function __construct(RouteProviderInterface $provider, OutboundPathProces
} }
/** /**
* Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setRequest(). * {@inheritdoc}
*/ */
public function setRequest(Request $request) { public function setRequest(Request $request) {
$this->request = $request; $this->request = $request;
...@@ -108,7 +108,7 @@ public function setRequest(Request $request) { ...@@ -108,7 +108,7 @@ public function setRequest(Request $request) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getPathFromRoute($name, $parameters = array()) { public function getPathFromRoute($name, $parameters = array()) {
$route = $this->getRoute($name, $parameters); $route = $this->getRoute($name);
$path = $this->getInternalPathFromRoute($route, $parameters); $path = $this->getInternalPathFromRoute($route, $parameters);
// Router-based paths may have a querystring on them but Drupal paths may // Router-based paths may have a querystring on them but Drupal paths may
// not have one, so remove any ? and anything after it. For generate() this // not have one, so remove any ? and anything after it. For generate() this
...@@ -157,18 +157,41 @@ protected function getInternalPathFromRoute(SymfonyRoute $route, $parameters = a ...@@ -157,18 +157,41 @@ protected function getInternalPathFromRoute(SymfonyRoute $route, $parameters = a
* {@inheritdoc} * {@inheritdoc}
*/ */
public function generate($name, $parameters = array(), $absolute = FALSE) { public function generate($name, $parameters = array(), $absolute = FALSE) {
$route = $this->getRoute($name, $parameters); $options['absolute'] = $absolute;
$path = $this->getInternalPathFromRoute($route, $parameters); return $this->generateFromRoute($name, $parameters, $options);
$path = $this->processPath($path); }
/**
* {@inheritdoc}
*/
public function generateFromRoute($name, $parameters = array(), $options = array()) {
$absolute = !empty($options['absolute']);
$route = $this->getRoute($name);
// Symfony adds any parameters that are not path slugs as query strings.
if (isset($options['query']) && is_array($options['query'])) {
$parameters = (array) $parameters + $options['query'];
}
$path = $this->getInternalPathFromRoute($route, $parameters);
$path = $this->processPath($path, $options);
$fragment = '';
if (isset($options['fragment'])) {
if (($fragment = trim($options['fragment'])) != '') {
$fragment = '#' . $fragment;
}
}
$base_url = $this->context->getBaseUrl(); $base_url = $this->context->getBaseUrl();
if (!$absolute || !$host = $this->context->getHost()) { if (!$absolute || !$host = $this->context->getHost()) {
return $base_url . $path; return $base_url . $path . $fragment;
} }
// Prepare an absolute URL by getting the correct scheme, host and port from // Prepare an absolute URL by getting the correct scheme, host and port from
// the request context. // the request context.
$scheme = $this->context->getScheme(); if (isset($options['https']) && $this->mixedModeSessions) {
$scheme = $options['https'] ? 'https' : 'http';
}
else {
$scheme = $this->context->getScheme();
}
$scheme_req = $route->getRequirement('_scheme'); $scheme_req = $route->getRequirement('_scheme');
if (isset($scheme_req) && ($req = strtolower($scheme_req)) && $scheme !== $req) { if (isset($scheme_req) && ($req = strtolower($scheme_req)) && $scheme !== $req) {
$scheme = $req; $scheme = $req;
...@@ -179,68 +202,11 @@ public function generate($name, $parameters = array(), $absolute = FALSE) { ...@@ -179,68 +202,11 @@ public function generate($name, $parameters = array(), $absolute = FALSE) {
} elseif ('https' === $scheme && 443 != $this->context->getHttpsPort()) { } elseif ('https' === $scheme && 443 != $this->context->getHttpsPort()) {
$port = ':' . $this->context->getHttpsPort(); $port = ':' . $this->context->getHttpsPort();
} }
return $scheme . '://' . $host . $port . $base_url . $path; return $scheme . '://' . $host . $port . $base_url . $path . $fragment;
} }
/** /**
* Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::generateFromPath(). * {@inheritdoc}
*
* @param $path
* (optional) The internal path or external URL being linked to, such as
* "node/34" or "http://example.com/foo". The default value is equivalent to
* passing in '<front>'. A few notes:
* - If you provide a full URL, it will be considered an external URL.
* - If you provide only the path (e.g. "node/34"), it will be
* considered an internal link. In this case, it should be a system URL,
* and it will be replaced with the alias, if one exists. Additional query
* arguments for internal paths must be supplied in $options['query'], not
* included in $path.
* - If you provide an internal path and $options['alias'] is set to TRUE, the
* path is assumed already to be the correct path alias, and the alias is
* not looked up.
* - The special string '<front>' generates a link to the site's base URL.
* - If your external URL contains a query (e.g. http://example.com/foo?a=b),
* then you can either URL encode the query keys and values yourself and
* include them in $path, or use $options['query'] to let this method
* URL encode them.
*
* @param $options
* (optional) An associative array of additional options, with the following
* elements:
* - 'query': An array of query key/value-pairs (without any URL-encoding) to
* append to the URL.
* - 'fragment': A fragment identifier (named anchor) to append to the URL.
* Do not include the leading '#' character.
* - 'absolute': Defaults to FALSE. Whether to force the output to be an
* absolute link (beginning with http:). Useful for links that will be
* displayed outside the site, such as in an RSS feed.
* - 'alias': Defaults to FALSE. Whether the given path is a URL alias
* already.
* - 'external': Whether the given path is an external URL.
* - 'language': An optional language object. If the path being linked to is
* internal to the site, $options['language'] is used to look up the alias
* for the URL. If $options['language'] is omitted, the language will be
* obtained from language(Language::TYPE_URL).
* - 'https': Whether this URL should point to a secure location. If not
* defined, the current scheme is used, so the user stays on HTTP or HTTPS
* respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can
* only be enforced when the variable 'https' is set to TRUE.
* - 'base_url': Only used internally, to modify the base URL when a language
* dependent URL requires so.
* - 'prefix': Only used internally, to modify the path when a language
* dependent URL requires so.
* - 'script': Added to the URL between the base path and the path prefix.
* Defaults to empty string when clean URLs are in effect, and to
* 'index.php/' when they are not.
* - 'entity_type': The entity type of the object that called url(). Only
* set if url() is invoked by Drupal\Core\Entity\Entity::uri().
* - 'entity': The entity object (such as a node) for which the URL is being
* generated. Only set if url() is invoked by Drupal\Core\Entity\Entity::uri().
*
* @return
* A string containing a URL to the given path.
*
* @throws \Drupal\Core\Routing\GeneratorNotInitializedException.
*/ */
public function generateFromPath($path = NULL, $options = array()) { public function generateFromPath($path = NULL, $options = array()) {
...@@ -329,21 +295,21 @@ public function generateFromPath($path = NULL, $options = array()) { ...@@ -329,21 +295,21 @@ public function generateFromPath($path = NULL, $options = array()) {
} }
/** /**
* Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setBaseUrl(). * {@inheritdoc}
*/ */
public function setBaseUrl($url) { public function setBaseUrl($url) {
$this->baseUrl = $url; $this->baseUrl = $url;
} }
/** /**
* Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setBasePath(). * {@inheritdoc}
*/ */
public function setBasePath($path) { public function setBasePath($path) {
$this->basePath = $path; $this->basePath = $path;
} }
/** /**
* Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setScriptPath(). * {@inheritdoc}
*/ */
public function setScriptPath($path) { public function setScriptPath($path) {
$this->scriptPath = $path; $this->scriptPath = $path;
...@@ -381,13 +347,10 @@ protected function initialized() { ...@@ -381,13 +347,10 @@ protected function initialized() {
} }
/** /**
* Find the route using the provided route name (and parameters). * Find the route using the provided route name.
* *
* @param string $name * @param string $name
* The route name to fetch * The route name to fetch
* @param array $parameters
* The parameters as they are passed to the UrlGeneratorInterface::generate
* call.
* *
* @return \Symfony\Component\Routing\Route * @return \Symfony\Component\Routing\Route
* The found route. * The found route.
...@@ -397,11 +360,11 @@ protected function initialized() { ...@@ -397,11 +360,11 @@ protected function initialized() {
* *
* @see \Drupal\Core\Routing\RouteProviderInterface * @see \Drupal\Core\Routing\RouteProviderInterface
*/ */
protected function getRoute($name, $parameters) { protected function getRoute($name) {
if ($name instanceof SymfonyRoute) { if ($name instanceof SymfonyRoute) {
$route = $name; $route = $name;
} }
elseif (NULL === $route = $this->provider->getRouteByName($name, $parameters)) { elseif (NULL === $route = $this->provider->getRouteByName($name)) {
throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name)); throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
} }
return $route; return $route;
......
...@@ -2,30 +2,83 @@ ...@@ -2,30 +2,83 @@
/** /**
* @file * @file
* Contains Drupal\Core\Routing\PathBasedGeneratorInterface. * Contains \Drupal\Core\Routing\UrlGeneratorInterface.
*/ */
namespace Drupal\Core\Routing; namespace Drupal\Core\Routing;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Cmf\Component\Routing\VersatileGeneratorInterface;
/** /**
* Defines an interface for generating a url from a path as opposed to a route. * Defines an interface for generating a url from a route or system path.
*
* Provides additional methods and options not present in the base interface.
*/ */
interface PathBasedGeneratorInterface { interface UrlGeneratorInterface extends VersatileGeneratorInterface {
/** /**
* Generates an internal or external URL. * Generates an internal or external URL.
* *
* @param $path * @param string $path
* (optional) The internal path or external URL being linked to, such as * (optional) The internal path or external URL being linked to, such as
* "node/34" or "http://example.com/foo". * "node/34" or "http://example.com/foo". The default value is equivalent to
* * passing in '<front>'. A few notes:
* @param $options * - If you provide a full URL, it will be considered an external URL.
* (optional) An associative array of additional options. * - If you provide only the path (e.g. "node/34"), it will be
* considered an internal link. In this case, it should be a system URL,
* and it will be replaced with the alias, if one exists. Additional query
* arguments for internal paths must be supplied in $options['query'], not
* included in $path.
* - If you provide an internal path and $options['alias'] is set to TRUE, the
* path is assumed already to be the correct path alias, and the alias is
* not looked up.
* - The special string '<front>' generates a link to the site's base URL.
* - If your external URL contains a query (e.g. http://example.com/foo?a=b),
* then you can either URL encode the query keys and values yourself and
* include them in $path, or use $options['query'] to let this method
* URL encode them.
*
* @param array $options
* (optional) An associative array of additional options, with the following
* elements:
* - 'query': An array of query key/value-pairs (without any URL-encoding) to
* append to the URL.
* - 'fragment': A fragment identifier (named anchor) to append to the URL.
* Do not include the leading '#' character.
* - 'absolute': Defaults to FALSE. Whether to force the output to be an
* absolute link (beginning with http:). Useful for links that will be
* displayed outside the site, such as in an RSS feed.
* - 'alias': Defaults to FALSE. Whether the given path is a URL alias
* already.
* - 'external': Whether the given path is an external URL.
* - 'language': An optional language object. If the path being linked to is
* internal to the site, $options['language'] is used to look up the alias
* for the URL. If $options['language'] is omitted, the language will be
* obtained from language(Language::TYPE_URL).
* - 'https': Whether this URL should point to a secure location. If not
* defined, the current scheme is used, so the user stays on HTTP or HTTPS
* respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can
* only be enforced when the variable 'https' is set to TRUE.
* - 'base_url': Only used internally, to modify the base URL when a language
* dependent URL requires so.
* - 'prefix': Only used internally, to modify the path when a language
* dependent URL requires so.
* - 'script': Added to the URL between the base path and the path prefix.
* Defaults to empty string when clean URLs are in effect, and to
* 'index.php/' when they are not.
* - 'entity_type': The entity type of the object that called url(). Only
* set if url() is invoked by Drupal\Core\Entity\Entity::uri().
* - 'entity': The entity object (such as a node) for which the URL is being
* generated. Only set if url() is invoked by Drupal\Core\Entity\Entity::uri().
* *
* @return * @return
* A string containing a URL to the given path. * A string containing a URL to the given path.
*
* @throws \Drupal\Core\Routing\GeneratorNotInitializedException.
*
* @deprecated since version 8.0
* System paths should not be used - use route names and parameters.
*/ */
public function generateFromPath($path = NULL, $options = array()); public function generateFromPath($path = NULL, $options = array());
...@@ -40,9 +93,51 @@ public function generateFromPath($path = NULL, $options = array()); ...@@ -40,9 +93,51 @@ public function generateFromPath($path = NULL, $options = array());
* *
* @return string * @return string
* The internal Drupal path corresponding to the route. * The internal Drupal path corresponding to the route.
*
* @deprecated since version 8.0
* System paths should not be used - use route names and parameters.
*/ */
public function getPathFromRoute($name, $parameters = array()); public function getPathFromRoute($name, $parameters = array());
/**
* Generates a URL or path for a specific route based on the given parameters.
*
* Parameters that reference placeholders in the route pattern will be
* substituted for them in the pattern. Extra params are added as query
* strings to the URL.
*
* @param string $name
* The name of the route
* @param array $parameters
* An associative array of parameter names and values.
* @param array $options
* (optional) An associative array of additional options, with the following
* elements:
* - 'query': An array of query key/value-pairs (without any URL-encoding)
* to append to the URL. Merged with the parameters array.
* - 'fragment': A fragment identifier (named anchor) to append to the URL.
* Do not include the leading '#' character.
* - 'absolute': Defaults to FALSE. Whether to force the output to be an
* absolute link (beginning with http:). Useful for links that will be
* displayed outside the site, such as in an RSS feed.
* - 'language': An optional language object used to look up the alias
* for the URL. If $options['language'] is omitted, the language will be
* obtained from language(Language::TYPE_URL).
* - 'https': Whether this URL should point to a secure location. If not
* defined, the current scheme is used, so the user stays on HTTP or HTTPS
* respectively. if mixed mode sessions are permitted, TRUE enforces HTTPS
* and FALSE enforces HTTP.
*
* @return string
* The generated URL for the given route.
*
* @throws RouteNotFoundException If the named route doesn't exist
* @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route
* @throws InvalidParameterException When a parameter value for a placeholder is not correct because
* it does not match the requirement
*/
public function generateFromRoute($name, $parameters = array(), $options = array());
/** /**
* Sets the $request property. * Sets the $request property.
* *
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
use Drupal\Core\Annotation\Translation; use Drupal\Core\Annotation\Translation;
use Drupal\Core\Action\ConfigurableActionBase; use Drupal\Core\Action\ConfigurableActionBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Routing\PathBasedGeneratorInterface; use Drupal\Core\Routing\UrlGeneratorInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
...@@ -38,7 +38,7 @@ class GotoAction extends ConfigurableActionBase implements ContainerFactoryPlugi ...@@ -38,7 +38,7 @@ class GotoAction extends ConfigurableActionBase implements ContainerFactoryPlugi
/** /**
* The url generator service. * The url generator service.
* *
* @var \Drupal\Core\Routing\PathBasedGeneratorInterface * @var \Drupal\Core\Routing\UrlGeneratorInterface
*/ */
protected $urlGenerator; protected $urlGenerator;
...@@ -53,10 +53,10 @@ class GotoAction extends ConfigurableActionBase implements ContainerFactoryPlugi ...@@ -53,10 +53,10 @@ class GotoAction extends ConfigurableActionBase implements ContainerFactoryPlugi
* The plugin implementation definition. * The plugin implementation definition.
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
* The tempstore factory. * The tempstore factory.
* @param \Drupal\Core\Routing\PathBasedGeneratorInterface $url_generator * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator
* The url generator service. * The url generator service.
*/ */
public function __construct(array $configuration, $plugin_id, array $plugin_definition, EventDispatcherInterface $dispatcher, PathBasedGeneratorInterface $url_generator) { public function __construct(array $configuration, $plugin_id, array $plugin_definition, EventDispatcherInterface $dispatcher, UrlGeneratorInterface $url_generator) {
parent::__construct($configuration, $plugin_id, $plugin_definition); parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->dispatcher = $dispatcher; $this->dispatcher = $dispatcher;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
use Drupal\Core\Database\Connection; use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Routing\PathBasedGeneratorInterface; use Drupal\Core\Routing\UrlGeneratorInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -55,7 +55,7 @@ class AggregatorController implements ControllerInterface { ...@@ -55,7 +55,7 @@ class AggregatorController implements ControllerInterface {
/** /**
* The url generator. * The url generator.
* *
* @var \Drupal\Core\Routing\PathBasedGeneratorInterface * @var \Drupal\Core\Routing\UrlGeneratorInterface
*/ */
protected $urlGenerator; protected $urlGenerator;
...@@ -73,7 +73,7 @@ class AggregatorController implements ControllerInterface { ...@@ -73,7 +73,7 @@ class AggregatorController implements ControllerInterface {
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler. * The module handler.
*/ */
public function __construct(EntityManager $entity_manager, Connection $database, ConfigFactory $config_factory, ModuleHandlerInterface $module_handler, PathBasedGeneratorInterface $url_generator) { public function __construct(EntityManager $entity_manager, Connection $database, ConfigFactory $config_factory, ModuleHandlerInterface $module_handler, UrlGeneratorInterface $url_generator) {
$this->entityManager = $entity_manager; $this->entityManager = $entity_manager;
$this->database = $database; $this->database = $database;
$this->configFactory = $config_factory; $this->configFactory = $config_factory;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
use Drupal\comment\CommentInterface; use Drupal\comment\CommentInterface;
use Drupal\comment\Entity\Comment; use Drupal\comment\Entity\Comment;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\Controller\ControllerInterface;
use Drupal\Core\Routing\PathBasedGeneratorInterface; use Drupal\Core\Routing\UrlGeneratorInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -28,7 +28,7 @@ class CommentController implements ControllerInterface { ...@@ -28,7 +28,7 @@ class CommentController implements ControllerInterface {
/**