diff --git a/core/core.services.yml b/core/core.services.yml index 3eee8fd..e111880 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -553,7 +553,7 @@ services: arguments: ['@current_route_match'] router.route_provider: class: Drupal\Core\Routing\RouteProvider - arguments: ['@database', '@router.builder', '@state', '@path.current'] + arguments: ['@database', '@state', '@path.current'] tags: - { name: event_subscriber } - { name: backend_overridable } diff --git a/core/lib/Drupal/Core/Routing/RouteBuilder.php b/core/lib/Drupal/Core/Routing/RouteBuilder.php index 74d60d6..db516af 100644 --- a/core/lib/Drupal/Core/Routing/RouteBuilder.php +++ b/core/lib/Drupal/Core/Routing/RouteBuilder.php @@ -73,14 +73,14 @@ class RouteBuilder implements RouteBuilderInterface, DestructableInterface { protected $routeCollection; /** - * Flag that indiciates if we are currently rebuilding the routes. + * Flag that indicates if we are currently rebuilding the routes. * * @var bool */ protected $building = FALSE; /** - * Flag that indiciates if we should rebuild at the end of the request. + * Flag that indicates if we should rebuild at the end of the request. * * @var bool */ diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php index 86ecbd1..1f3e580 100644 --- a/core/lib/Drupal/Core/Routing/RouteProvider.php +++ b/core/lib/Drupal/Core/Routing/RouteProvider.php @@ -40,13 +40,6 @@ class RouteProvider implements RouteProviderInterface, PagedRouteProviderInterfa protected $tableName; /** - * The route builder. - * - * @var \Drupal\Core\Routing\RouteBuilderInterface - */ - protected $routeBuilder; - - /** * The state. * * @var \Drupal\Core\State\StateInterface @@ -72,8 +65,6 @@ class RouteProvider implements RouteProviderInterface, PagedRouteProviderInterfa * * @param \Drupal\Core\Database\Connection $connection * A database connection object. - * @param \Drupal\Core\Routing\RouteBuilderInterface $route_builder - * The route builder. * @param \Drupal\Core\State\StateInterface $state * The state. * @param \Drupal\Core\Path\CurrentPathStack $current_path @@ -81,9 +72,8 @@ class RouteProvider implements RouteProviderInterface, PagedRouteProviderInterfa * @param string $table * The table in the database to use for matching. */ - public function __construct(Connection $connection, RouteBuilderInterface $route_builder, StateInterface $state, CurrentPathStack $current_path, $table = 'router') { + public function __construct(Connection $connection, StateInterface $state, CurrentPathStack $current_path, $table = 'router') { $this->connection = $connection; - $this->routeBuilder = $route_builder; $this->state = $state; $this->tableName = $table; $this->currentPath = $current_path; diff --git a/core/modules/system/src/Tests/Routing/RouteProviderTest.php b/core/modules/system/src/Tests/Routing/RouteProviderTest.php index f8e4c5a..c9af886 100644 --- a/core/modules/system/src/Tests/Routing/RouteProviderTest.php +++ b/core/modules/system/src/Tests/Routing/RouteProviderTest.php @@ -21,7 +21,6 @@ use Drupal\Core\Database\Database; use Drupal\Core\Routing\MatcherDumper; use Drupal\Tests\Core\Routing\RoutingFixtures; -use Drupal\Tests\Core\Routing\NullRouteBuilder; /** * Confirm that the default route provider is working correctly. @@ -38,13 +37,6 @@ class RouteProviderTest extends KernelTestBase { protected $fixtures; /** - * A null route builder to enable testing of the route provider. - * - * @var \Drupal\Core\Routing\RouteBuilderInterface - */ - protected $routeBuilder; - - /** * The state. * * @var \Drupal\Core\State\StateInterface @@ -61,7 +53,6 @@ class RouteProviderTest extends KernelTestBase { protected function setUp() { parent::setUp(); $this->fixtures = new RoutingFixtures(); - $this->routeBuilder = new NullRouteBuilder(); $this->state = new State(new KeyValueMemoryFactory()); $this->currentPath = new CurrentPathStack(new RequestStack()); } @@ -78,7 +69,7 @@ protected function tearDown() { public function testCandidateOutlines() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $parts = array('node', '5', 'edit'); @@ -101,7 +92,7 @@ public function testCandidateOutlines() { */ function testExactPathMatch() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -125,7 +116,7 @@ function testExactPathMatch() { */ function testOutlinePathMatch() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -154,7 +145,7 @@ function testOutlinePathMatch() { */ function testOutlinePathMatchTrailingSlash() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -183,7 +174,7 @@ function testOutlinePathMatchTrailingSlash() { */ function testOutlinePathMatchDefaults() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -221,7 +212,7 @@ function testOutlinePathMatchDefaults() { */ function testOutlinePathMatchDefaultsCollision() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -260,7 +251,7 @@ function testOutlinePathMatchDefaultsCollision() { */ function testOutlinePathMatchDefaultsCollision2() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -299,7 +290,7 @@ function testOutlinePathMatchDefaultsCollision2() { */ public function testOutlinePathMatchZero() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -334,7 +325,7 @@ public function testOutlinePathMatchZero() { */ function testOutlinePathNoMatch() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -359,7 +350,7 @@ function testOutlinePathNoMatch() { */ function testCurrentPath() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -384,7 +375,7 @@ function testCurrentPath() { */ public function testRouteByName() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); @@ -419,7 +410,7 @@ public function testRouteByName() { */ public function testGetRoutesByPatternWithLongPatterns() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); // This pattern has only 3 parts, so we will get candidates, but no routes, @@ -477,7 +468,7 @@ public function testGetRoutesByPatternWithLongPatterns() { */ public function testGetRoutesPaged() { $connection = Database::getConnection(); - $provider = new RouteProvider($connection, $this->routeBuilder, $this->state, $this->currentPath, 'test_routes'); + $provider = new RouteProvider($connection, $this->state, $this->currentPath, 'test_routes'); $this->fixtures->createTables($connection); $dumper = new MatcherDumper($connection, $this->state, 'test_routes'); diff --git a/core/tests/Drupal/Tests/Core/Routing/NullRouteBuilder.php b/core/tests/Drupal/Tests/Core/Routing/NullRouteBuilder.php deleted file mode 100644 index 58cb2af..0000000 --- a/core/tests/Drupal/Tests/Core/Routing/NullRouteBuilder.php +++ /dev/null @@ -1,22 +0,0 @@ -