Skip to content
Snippets Groups Projects
Verified Commit 7454e5df authored by Dave Long's avatar Dave Long
Browse files

Issue #3347710 by andypost: [11.x] Remove deprecated non_lazy_route_enhancer...

Issue #3347710 by andypost: [11.x] Remove deprecated non_lazy_route_enhancer and non_lazy_route_filter
parent 60d51622
No related branches found
No related tags found
No related merge requests found
...@@ -1081,9 +1081,7 @@ services: ...@@ -1081,9 +1081,7 @@ services:
class: \Drupal\Core\Routing\Router class: \Drupal\Core\Routing\Router
arguments: ['@router.route_provider', '@path.current', '@url_generator'] arguments: ['@router.route_provider', '@path.current', '@url_generator']
tags: tags:
- { name: service_collector, tag: non_lazy_route_enhancer, call: addDeprecatedRouteEnhancer }
- { name: service_collector, tag: route_enhancer, call: addRouteEnhancer } - { name: service_collector, tag: route_enhancer, call: addRouteEnhancer }
- { name: service_collector, tag: non_lazy_route_filter, call: addDeprecatedRouteFilter }
- { name: service_collector, tag: route_filter, call: addRouteFilter } - { name: service_collector, tag: route_filter, call: addRouteFilter }
calls: calls:
- [setContext, ['@router.request_context']] - [setContext, ['@router.request_context']]
......
...@@ -84,22 +84,6 @@ public function addRouteFilter(FilterInterface $route_filter) { ...@@ -84,22 +84,6 @@ public function addRouteFilter(FilterInterface $route_filter) {
$this->filters[] = $route_filter; $this->filters[] = $route_filter;
} }
/**
* Adds a deprecated route filter.
*
* @param \Drupal\Core\Routing\FilterInterface $route_filter
* The route filter.
*
* @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
* route_filter instead.
*
* @see https://www.drupal.org/node/2894934
*/
public function addDeprecatedRouteFilter(FilterInterface $route_filter) {
@trigger_error('non_lazy_route_filter is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use route_filter instead. See https://www.drupal.org/node/2894934', E_USER_DEPRECATED);
$this->filters[] = $route_filter;
}
/** /**
* Adds a route enhancer. * Adds a route enhancer.
* *
...@@ -110,22 +94,6 @@ public function addRouteEnhancer(EnhancerInterface $route_enhancer) { ...@@ -110,22 +94,6 @@ public function addRouteEnhancer(EnhancerInterface $route_enhancer) {
$this->enhancers[] = $route_enhancer; $this->enhancers[] = $route_enhancer;
} }
/**
* Adds a deprecated route enhancer.
*
* @param \Drupal\Core\Routing\EnhancerInterface $route_enhancer
* The route enhancer.
*
* @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
* route_enhancer instead.
*
* @see https://www.drupal.org/node/2894934
*/
public function addDeprecatedRouteEnhancer(EnhancerInterface $route_enhancer) {
@trigger_error('non_lazy_route_enhancer is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use route_enhancer instead. See https://www.drupal.org/node/2894934', E_USER_DEPRECATED);
$this->enhancers[] = $route_enhancer;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
namespace Drupal\Tests\Core\Routing; namespace Drupal\Tests\Core\Routing;
use Drupal\Core\Path\CurrentPathStack; use Drupal\Core\Path\CurrentPathStack;
use Drupal\Core\Routing\EnhancerInterface;
use Drupal\Core\Routing\FilterInterface;
use Drupal\Core\Routing\RouteProviderInterface; use Drupal\Core\Routing\RouteProviderInterface;
use Drupal\Core\Routing\Router; use Drupal\Core\Routing\Router;
use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\Core\Routing\UrlGeneratorInterface;
...@@ -37,29 +35,4 @@ public function testGenerateUnsupported() { ...@@ -37,29 +35,4 @@ public function testGenerateUnsupported() {
$router->generate($route_name); $router->generate($route_name);
} }
/**
* @covers ::addDeprecatedRouteFilter
* @covers ::addDeprecatedRouteEnhancer
*/
public function testDeprecatedAdd() {
// Test needs access to router's protected properties.
$filters = new \ReflectionProperty(Router::class, 'filters');
$enhancers = new \ReflectionProperty(Router::class, 'enhancers');
$route_provider = $this->prophesize(RouteProviderInterface::class);
$current_path_stack = $this->prophesize(CurrentPathStack::class);
$url_generator = $this->prophesize(UrlGeneratorInterface::class);
$router = new Router($route_provider->reveal(), $current_path_stack->reveal(), $url_generator->reveal());
$this->expectDeprecation('non_lazy_route_filter is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use route_filter instead. See https://www.drupal.org/node/2894934');
$filter = $this->prophesize(FilterInterface::class)->reveal();
$router->addDeprecatedRouteFilter($filter);
$this->assertSame($filter, $filters->getValue($router)[0]);
$this->expectDeprecation('non_lazy_route_enhancer is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use route_enhancer instead. See https://www.drupal.org/node/2894934');
$enhancer = $this->prophesize(EnhancerInterface::class)->reveal();
$router->addDeprecatedRouteEnhancer($enhancer);
$this->assertSame($enhancer, $enhancers->getValue($router)[0]);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment