Verified Commit 56e3f8e0 authored by quietone's avatar quietone
Browse files

Issue #3493958 by jquijano, kim.pepper, dcam, adwivedi008: Remove File token hook dead code

parent 622e3cc1
Loading
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -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;
@@ -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,
  ) {}
@@ -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');