Loading core/modules/file/src/Hook/TokenHooks.php +1 −10 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Hook\Attribute\Hook; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Render\BubbleableMetadata; use Drupal\Core\StringTranslation\ByteSizeMarkup; use Drupal\Core\StringTranslation\StringTranslationTrait; Loading @@ -22,7 +21,6 @@ class TokenHooks { public function __construct( private readonly Token $token, private readonly LanguageManagerInterface $languageManager, private readonly DateFormatterInterface $dateFormatter, private readonly EntityTypeManagerInterface $entityTypeManager, ) {} Loading @@ -32,14 +30,7 @@ public function __construct( */ #[Hook('tokens')] public function tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata): array { $url_options = ['absolute' => TRUE]; if (isset($options['langcode'])) { $url_options['language'] = $this->languageManager->getLanguage($options['langcode']); $langcode = $options['langcode']; } else { $langcode = NULL; } $langcode = $options['langcode'] ?? NULL; $replacements = []; if ($type == 'file' && !empty($data['file'])) { $dateFormatStorage = $this->entityTypeManager->getStorage('date_format'); Loading Loading
core/modules/file/src/Hook/TokenHooks.php +1 −10 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Hook\Attribute\Hook; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Render\BubbleableMetadata; use Drupal\Core\StringTranslation\ByteSizeMarkup; use Drupal\Core\StringTranslation\StringTranslationTrait; Loading @@ -22,7 +21,6 @@ class TokenHooks { public function __construct( private readonly Token $token, private readonly LanguageManagerInterface $languageManager, private readonly DateFormatterInterface $dateFormatter, private readonly EntityTypeManagerInterface $entityTypeManager, ) {} Loading @@ -32,14 +30,7 @@ public function __construct( */ #[Hook('tokens')] public function tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata): array { $url_options = ['absolute' => TRUE]; if (isset($options['langcode'])) { $url_options['language'] = $this->languageManager->getLanguage($options['langcode']); $langcode = $options['langcode']; } else { $langcode = NULL; } $langcode = $options['langcode'] ?? NULL; $replacements = []; if ($type == 'file' && !empty($data['file'])) { $dateFormatStorage = $this->entityTypeManager->getStorage('date_format'); Loading