You are here

public function TrailingSlashServiceProvider::alter in Trailing Slash 8

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

src/TrailingSlashServiceProvider.php, line 19

Class

TrailingSlashServiceProvider
Class TrailingSlashServiceProvider.

Namespace

Drupal\trailing_slash

Code

public function alter(ContainerBuilder $container) : void {
  if ($container
    ->hasDefinition('url_generator.non_bubbling') && $container
    ->hasDefinition('path_processor_language')) {
    $container
      ->getDefinition('url_generator.non_bubbling')
      ->setClass('Drupal\\trailing_slash\\Routing\\TrailingSlashUrlGenerator')
      ->addArgument(new Reference('path_processor_language'));
  }
}