diff --git a/token.tokens.inc b/token.tokens.inc
index 4b43404..1d63a3c 100755
--- a/token.tokens.inc
+++ b/token.tokens.inc
@@ -424,7 +424,7 @@ function token_token_info() {
 /**
  * Implements hook_tokens().
  */
-function token_tokens($type, array $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata) {
+function token_tokens($type, array $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata = NULL) {
   $replacements = [];
   $language_manager = \Drupal::languageManager();
   $url_options = ['absolute' => TRUE];
@@ -436,6 +436,10 @@ function token_tokens($type, array $tokens, array $data = [], array $options = [
     $langcode = $language_manager->getCurrentLanguage()->getId();
   }
 
+  if (is_null($bubbleable_metadata)) {
+    $bubbleable_metadata = new BubbleableMetadata();
+  }
+
   // Date tokens.
   if ($type == 'date') {
     $date = !empty($data['date']) ? $data['date'] : \Drupal::time()->getRequestTime();
@@ -1097,9 +1101,13 @@ function book_token_info() {
 /**
  * Implements hook_tokens() on behalf of book.module.
  */
-function book_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata) {
+function book_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata = NULL) {
   $replacements = [];
 
+  if (is_null($bubbleable_metadata)) {
+    $bubbleable_metadata = new BubbleableMetadata();
+  }
+
   // Node tokens.
   if ($type == 'node' && !empty($data['node'])) {
     $book = $data['node']->book;
@@ -1215,9 +1223,13 @@ function menu_ui_token_info() {
 /**
  * Implements hook_tokens() on behalf of menu_ui.module.
  */
-function menu_ui_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata) {
+function menu_ui_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata = NULL) {
   $replacements = [];
 
+  if (is_null($bubbleable_metadata)) {
+    $bubbleable_metadata = new BubbleableMetadata();
+  }
+
   /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
   $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
 
@@ -1552,8 +1564,13 @@ function _token_field_label($entity_type, $field_name) {
 /**
  * Implements hook_tokens() on behalf of field.module.
  */
-function field_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata) {
+function field_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata = NULL) {
   $replacements = [];
+
+  if (is_null($bubbleable_metadata)) {
+    $bubbleable_metadata = new BubbleableMetadata();
+  }
+
   $langcode = isset($options['langcode']) ? $options['langcode'] : NULL;
   // Entity tokens.
   if ($type == 'entity' && !empty($data['entity_type']) && !empty($data['entity']) && !empty($data['token_type'])) {
