diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php index 48b2d8c1d16ba57fd0fe60d7c87b164fca8aa0b3..be304cfcfaacc2dd80a4c0a8f95ecb02b47dc81b 100644 --- a/core/lib/Drupal/Core/Routing/MatcherDumper.php +++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php @@ -8,7 +8,6 @@ namespace Drupal\Core\Routing; use Symfony\Component\Routing\Matcher\Dumper\MatcherDumperInterface; -use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; use Drupal\Core\Database\Connection; diff --git a/core/lib/Drupal/Core/Routing/MimeTypeMatcher.php b/core/lib/Drupal/Core/Routing/MimeTypeMatcher.php index 8d8609620ba068ede321e068738e1e93dc14d414..031b2a2dae18e6fca01d7eafe484262f10377a73 100644 --- a/core/lib/Drupal/Core/Routing/MimeTypeMatcher.php +++ b/core/lib/Drupal/Core/Routing/MimeTypeMatcher.php @@ -19,7 +19,7 @@ class MimeTypeMatcher implements RouteFilterInterface { /** - * {@inheritDoc} + * Implements \Symfony\Cmf\Component\Routing\NestedMatcher\RouteFilterInterface::filter() */ public function filter(RouteCollection $collection, Request $request) { // Generates a list of Symfony formats matching the acceptable MIME types. diff --git a/core/lib/Drupal/Core/Routing/NullGenerator.php b/core/lib/Drupal/Core/Routing/NullGenerator.php index ff4d467cb172ad90e4387ff0d4559fd1c5b923ca..7228514b90477f9751582a9d78572b3e82d9fbd3 100644 --- a/core/lib/Drupal/Core/Routing/NullGenerator.php +++ b/core/lib/Drupal/Core/Routing/NullGenerator.php @@ -15,13 +15,22 @@ */ class NullGenerator implements UrlGeneratorInterface { + /** + * Implements Symfony\Component\Routing\Generator\UrlGeneratorInterface::generate(); + */ public function generate($name, $parameters = array(), $absolute = FALSE) { throw new RouteNotFoundException(); } + /** + * Implements Symfony\Component\Routing\RequestContextAwareInterface::setContext(); + */ public function setContext(RequestContext $context) { } + /** + * Implements Symfony\Component\Routing\RequestContextAwareInterface::getContext(); + */ public function getContext() { } } diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php index f4b281088d164d50e1e615059df3a945ba964579..75779a213cda38feed832eb3476148868a18eae7 100644 --- a/core/lib/Drupal/Core/Routing/UrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php @@ -7,13 +7,15 @@ namespace Drupal\Core\Routing; +use Symfony\Component\HttpKernel\Log\LoggerInterface; + use Symfony\Cmf\Component\Routing\ProviderBasedGenerator; use Symfony\Cmf\Component\Routing\RouteProviderInterface; use Drupal\Core\Path\AliasManagerInterface; /** - * Description of UrlGenerator + * A Generator creates URL strings based on a specified route. */ class UrlGenerator extends ProviderBasedGenerator { @@ -24,12 +26,25 @@ class UrlGenerator extends ProviderBasedGenerator { */ protected $aliasManager; + /** + * Constructs a new generator object. + * + * @param \Symfony\Cmf\Component\Routing\RouteProviderInterface $provider + * The route provider to be searched for routes. + * @param \Drupal\Core\Path\AliasManagerInterface $alias_manager + * The alias manager responsible for path aliasing. + * @param \Symfony\Component\HttpKernel\Log\LoggerInterface $logger + * An optional logger for recording errors. + */ public function __construct(RouteProviderInterface $provider, AliasManagerInterface $alias_manager, LoggerInterface $logger = NULL) { parent::__construct($provider, $logger); $this->aliasManager = $alias_manager; } + /** + * Implements Symfony\Component\Routing\Generator\UrlGeneratorInterface::generate(); + */ public function generate($name, $parameters = array(), $absolute = FALSE) { $path = parent::generate($name, $parameters, $absolute); diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/MimeTypeMatcherTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/MimeTypeMatcherTest.php index 07bb859493157fb09174c1d7242fab45ef34eb07..6061d5686a6e42adbbf68ddb8d89339da4e372e0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/MimeTypeMatcherTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/MimeTypeMatcherTest.php @@ -7,9 +7,7 @@ namespace Drupal\system\Tests\Routing; -use Drupal\Core\Routing\FirstEntryFinalMatcher; use Drupal\Core\Routing\MimeTypeMatcher; -use Drupal\Core\Routing\NestedMatcher; use Drupal\simpletest\UnitTestBase; use Symfony\Component\HttpFoundation\Request; diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/MockAliasManager.php b/core/modules/system/lib/Drupal/system/Tests/Routing/MockAliasManager.php index 0a606829693c8ca63f99003ee19770f687d3ebe5..6f5add490c85c3cd843ef27102f182901ffb7f37 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/MockAliasManager.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/MockAliasManager.php @@ -17,16 +17,41 @@ class MockAliasManager implements AliasManagerInterface { /** * Array of mocked aliases. Keys are system paths, followed by language. * - * @var type + * @var array */ protected $aliases = array(); + /** + * Array of mocked aliases. Keys are aliases, followed by language. + * + * @var array + */ protected $systemPaths = array(); + /** + * An index of aliases that have been requested. + * + * @var array + */ protected $lookedUp = array(); + /** + * The language to assume a path alias is for if not specified. + * + * @var string + */ public $defaultLanguage = 'en'; + /** + * Adds an alias to the in-memory alias table for this object. + * + * @param type $path + * The system path of the alias. + * @param type $alias + * The alias of the system path. + * @param type $path_language + * The language of this alias. + */ public function addAlias($path, $alias, $path_language = NULL) { $language = $path_language ?: $this->defaultLanguage; @@ -34,21 +59,33 @@ public function addAlias($path, $alias, $path_language = NULL) { $this->systemPaths[$alias][$language] = $path; } + /** + * Implements \Drupal\Core\Path\AliasManagerInterface::getSystemPath(). + */ public function getSystemPath($path, $path_language = NULL) { $language = $path_language ?: $this->defaultLanguage; return $this->systemPaths[$path][$language]; } + /** + * Implements \Drupal\Core\Path\AliasManagerInterface::getPathAlias(). + */ public function getPathAlias($path, $path_language = NULL) { $language = $path_language ?: $this->defaultLanguage; $this->lookedUp[$path] = 1; return $this->aliases[$path][$language]; } + /** + * Implements \Drupal\Core\Path\AliasManagerInterface::getPathLookups(). + */ public function getPathLookups() { return array_keys($this->lookedUp); } + /** + * Implements \Drupal\Core\Path\AliasManagerInterface::preloadPathLookups(). + */ public function preloadPathLookups(array $path_list) { // Not needed. } diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/MockController.php b/core/modules/system/lib/Drupal/system/Tests/Routing/MockController.php index fe09a7b85243da37e83f374dcd8b3a4af0523113..bc9d09393cc8c76c1d6b7195aa3b5f4e8c926e53 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/MockController.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/MockController.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\system\Tests\Routing\MockController. + * Contains Drupal\system\Tests\Routing\MockController. */ namespace Drupal\system\Tests\Routing; @@ -14,6 +14,9 @@ */ class MockController extends ContainerAware { + /** + * Does nothing; this is just a fake controller method. + */ public function run() {} } diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/MockMatcher.php b/core/modules/system/lib/Drupal/system/Tests/Routing/MockMatcher.php index 71611d464bd11ac6394fcc21c0b485c6e47a11a6..dc796b83551c11df784e8dc91cf1f72132949ebc 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/MockMatcher.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/MockMatcher.php @@ -9,15 +9,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Matcher\RequestMatcherInterface; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; -use Symfony\Component\Routing\Exception\RouteNotFoundException; -use Symfony\Component\Routing\Exception\MethodNotAllowedException; - -use Closure; /** * A mock matcher that can be configured with any matching logic for testing. - * */ class MockMatcher implements RequestMatcherInterface { @@ -26,10 +20,19 @@ class MockMatcher implements RequestMatcherInterface { */ protected $matcher; - public function __construct(Closure $matcher) { + /** + * Constructs a MockMatcher object. + * + * @param \Closure $matcher + * An anonymous function that will be used for the matchRequest() method. + */ + public function __construct(\Closure $matcher) { $this->matcher = $matcher; } + /** + * Implements \Symfony\Component\Routing\Matcher\RequestMatcherInterface::matchRequest(). + */ public function matchRequest(Request $request) { $matcher = $this->matcher; return $matcher($request); diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/MockRouteProvider.php b/core/modules/system/lib/Drupal/system/Tests/Routing/MockRouteProvider.php index 9b2a1048829d84b551bc3f72451841b2f1fa52e9..8cdf57e5f35d5a1543ca6c35617031233b0b1ab7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/MockRouteProvider.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/MockRouteProvider.php @@ -18,19 +18,34 @@ class MockRouteProvider implements RouteProviderInterface { /** + * A collection of routes for this route provider. * * @var RouteCollection */ protected $routes; + /** + * Constructs a new MockRouteProvider. + * + * @param \Symfony\Component\Routing\RouteCollection $routes + * The route collection to use for this provider. + */ public function __construct(RouteCollection $routes) { $this->routes = $routes; } + /** + * Implements \Symfony\Cmf\Component\Routing\RouteProviderInterface::getRouteCollectionForRequest(). + * + * Not implemented at present as it is not needed. + */ public function getRouteCollectionForRequest(Request $request) { } + /** + * Implements \Symfony\Cmf\Component\Routing\RouteProviderInterface::getRouteByName(). + */ public function getRouteByName($name, $parameters = array()) { $routes = $this->getRoutesByNames(array($name), $parameters); if (empty($routes)) { @@ -40,6 +55,9 @@ public function getRouteByName($name, $parameters = array()) { return reset($routes); } + /** + * Implements \Symfony\Cmf\Component\Routing\RouteProviderInterface::getRoutesByName(). + */ public function getRoutesByNames($names, $parameters = array()) { $routes = array(); foreach ($names as $name) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/RouteTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/RouteTest.php index 4fc7a111b9c0a715161b1bf4848e9520ab34c5f2..6e808e7cc61d356534a3e2fd3c7dcbd3e9aa793c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/RouteTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/RouteTest.php @@ -10,7 +10,6 @@ use Symfony\Component\Routing\Route; use Drupal\simpletest\UnitTestBase; -use Drupal\Core\Database\Database; /** * Basic tests for the Route. diff --git a/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ProviderBasedGenerator.php b/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ProviderBasedGenerator.php index 1c353f83589d39575b67fcc30f962905d7affc3c..6492667c6c01cd384f78e5e53b4d991b215047b4 100644 --- a/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ProviderBasedGenerator.php +++ b/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ProviderBasedGenerator.php @@ -6,7 +6,6 @@ use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Generator\UrlGenerator; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Cmf\Component\Routing\RouteProviderInterface;