TokenServiceProvider.php 452 B

1234567891011121314151617181920
  1. <?php
  2. namespace Drupal\token;
  3. use Drupal\Core\DependencyInjection\ContainerBuilder;
  4. use Drupal\Core\DependencyInjection\ServiceProviderBase;
  5. /**
  6. * Replace core's token service with our own.
  7. */
  8. class TokenServiceProvider extends ServiceProviderBase {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function alter(ContainerBuilder $container) {
  13. $definition = $container->getDefinition('token');
  14. $definition->setClass('\Drupal\token\Token');
  15. }
  16. }