AcceptHeaderRoutingTestServiceProvider.php

Same filename in other branches
  1. 9 core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php
  2. 10 core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php
  3. 11.x core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php

Namespace

Drupal\accept_header_routing_test

File

core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php

View source
<?php

namespace Drupal\accept_header_routing_test;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;

/**
 * Service provider for the accept_header_routing_test module.
 */
class AcceptHeaderRoutingTestServiceProvider implements ServiceModifierInterface {
    
    /**
     * {@inheritdoc}
     */
    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,
        ]);
    }

}

Classes

Title Deprecated Summary
AcceptHeaderRoutingTestServiceProvider Service provider for the accept_header_routing_test module.

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