Skip to content

Instantly share code, notes, and snippets.

@miteshmap
Created June 1, 2018 06:20
Show Gist options
  • Select an option

  • Save miteshmap/9994af03fd7edfa889ee252289190d06 to your computer and use it in GitHub Desktop.

Select an option

Save miteshmap/9994af03fd7edfa889ee252289190d06 to your computer and use it in GitHub Desktop.
Drupal 8: Service Decorators: TokenServiceProvider.php
<?php
/**
* Replace drupal core token service with our own.
*/
class TokenServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
$definition = $container->getDefinition('token');
$definition->setClass('\Drupal\token\Token');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment