You are here

TokenServiceProvider.php in Token 8

Namespace

Drupal\token

File

src/TokenServiceProvider.php
View source
<?php

namespace Drupal\token;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;

/**
 * Replace core's token service with our own.
 */
class TokenServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    $definition = $container
      ->getDefinition('token');
    $definition
      ->setClass('\\Drupal\\token\\Token');
  }

}

Classes

Namesort descending Description
TokenServiceProvider Replace core's token service with our own.