function AcceptHeaderRoutingTestServiceProvider::alter

Same name in other branches
  1. 9 core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php \Drupal\accept_header_routing_test\AcceptHeaderRoutingTestServiceProvider::alter()
  2. 8.9.x core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php \Drupal\accept_header_routing_test\AcceptHeaderRoutingTestServiceProvider::alter()
  3. 10 core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php \Drupal\accept_header_routing_test\AcceptHeaderRoutingTestServiceProvider::alter()

Overrides ServiceModifierInterface::alter

File

core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php, line 18

Class

AcceptHeaderRoutingTestServiceProvider
Service provider for the accept_header_routing_test module.

Namespace

Drupal\accept_header_routing_test

Code

public function alter(ContainerBuilder $container) {
    // Remove the basic content negotiation middleware and replace it with a
    // basic header based one.
    $container->register('http_middleware.negotiation', 'Drupal\\accept_header_routing_test\\AcceptHeaderMiddleware')
        ->addTag('http_middleware', [
        'priority' => 400,
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.