diff --git a/src/Hook/FileEntityFileHooks.php b/src/Hook/FileEntityFileHooks.php
index 06323ed..0c60355 100644
--- a/src/Hook/FileEntityFileHooks.php
+++ b/src/Hook/FileEntityFileHooks.php
@@ -6,41 +6,41 @@ use Drupal\file\FileInterface;
 use Drupal\file_entity\Entity\FileType;
 use Drupal\Core\Hook\Attribute\Hook;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
+
 /**
  * Hook implementations for file_entity.
  */
-class FileEntityFileHooks
-{
-    use StringTranslationTrait;
-    /**
-     * Implements hook_file_type().
-     */
-    #[Hook('file_type')]
-    public static function fileType(\Drupal\file\FileInterface $file)
-    {
-        $types = [
-        ];
-        foreach (\Drupal\file_entity\Entity\FileType::loadEnabled() as $type) {
-            if (file_entity_match_mimetypes($type->getMimeTypes(), $file->getMimeType())) {
-                $types[] = $type->id();
-            }
-        }
-        return $types;
-    }
-    /**
-     * Implements hook_file_metadata_info().
-     */
-    #[Hook('file_metadata_info')]
-    public function fileMetadataInfo()
-    {
-        $info['width'] = [
-            'label' => $this->t('Width'),
-            'type' => 'integer',
-        ];
-        $info['height'] = [
-            'label' => $this->t('Height'),
-            'type' => 'integer',
-        ];
-        return $info;
+class FileEntityFileHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_file_type().
+   */
+  #[Hook('file_type')]
+  public static function fileType(FileInterface $file) {
+    $types = [];
+    foreach (FileType::loadEnabled() as $type) {
+      if (file_entity_match_mimetypes($type->getMimeTypes(), $file->getMimeType())) {
+        $types[] = $type->id();
+      }
     }
+    return $types;
+  }
+
+  /**
+   * Implements hook_file_metadata_info().
+   */
+  #[Hook('file_metadata_info')]
+  public function fileMetadataInfo() {
+    $info['width'] = [
+      'label' => $this->t('Width'),
+      'type' => 'integer',
+    ];
+    $info['height'] = [
+      'label' => $this->t('Height'),
+      'type' => 'integer',
+    ];
+    return $info;
+  }
+
 }
diff --git a/src/Hook/FileEntityHooks.php b/src/Hook/FileEntityHooks.php
index 6da42ec..e96c799 100644
--- a/src/Hook/FileEntityHooks.php
+++ b/src/Hook/FileEntityHooks.php
@@ -3,346 +3,339 @@
 namespace Drupal\file_entity\Hook;
 
 use Drupal\Component\Utility\DeprecationHelper;
-use Drupal\Core\Render\Element;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Render\BubbleableMetadata;
 use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\Core\StreamWrapper\StreamWrapperInterface;
-use Drupal\file\Entity\File;
-use Drupal\file\FileInterface;
 use Drupal\file_entity\Entity\FileEntity;
-use Drupal\file_entity\Entity\FileType;
 use Drupal\Core\Hook\Attribute\Hook;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
+
 /**
  * Hook implementations for file_entity.
  */
-class FileEntityHooks
-{
-    use StringTranslationTrait;
-    /**
-     * Implements hook_hook_info_alter().
-     *
-     * Add support for existing core hooks to be located in modulename.file.inc.
-     */
-    #[Hook('hook_info_alter')]
-    public static function hookInfoAlter(&$info)
-    {
-        $hooks = [
-            // File API hooks
-            'file_copy',
-            'file_move',
-            'file_validate',
-            // File access
-            'file_download',
-            'file_download_access',
-            'file_download_access_alter',
-            // File entity hooks
-            'file_load',
-            'file_presave',
-            'file_insert',
-            'file_update',
-            'file_delete',
-            // Miscellaneous hooks
-            'file_mimetype_mapping_alter',
-            'file_url_alter',
-        ];
-        $info += array_fill_keys($hooks, [
-            'group' => 'file',
-        ]);
-    }
-    /**
-     * Implements hook_help().
-     */
-    #[Hook('help')]
-    public function help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
-    {
-        switch ($route_match) {
-            case 'entity.file_type.collection':
-                $output = '<p>' . $this->t('When a file is uploaded to this website, it is assigned one of the following types, based on what kind of file it is.') . '</p>';
-                return $output;
-        }
+class FileEntityHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_hook_info_alter().
+   *
+   * Add support for existing core hooks to be located in modulename.file.inc.
+   */
+  #[Hook('info_alter')]
+  public static function hookInfoAlter(&$info) {
+    $hooks = [
+          // File API hooks.
+      'file_copy',
+      'file_move',
+      'file_validate',
+          // File access.
+      'file_download',
+      'file_download_access',
+      'file_download_access_alter',
+          // File entity hooks.
+      'file_load',
+      'file_presave',
+      'file_insert',
+      'file_update',
+      'file_delete',
+          // Miscellaneous hooks.
+      'file_mimetype_mapping_alter',
+      'file_url_alter',
+    ];
+    $info += array_fill_keys($hooks, [
+      'group' => 'file',
+    ]);
+  }
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help($route_name, RouteMatchInterface $route_match) {
+    switch ($route_match) {
+      case 'entity.file_type.collection':
+        $output = '<p>' . $this->t('When a file is uploaded to this website, it is assigned one of the following types, based on what kind of file it is.') . '</p>';
+        return $output;
     }
-    /**
-     * Implements hook_action_info_alter().
-     */
-    #[Hook('action_info_alter')]
-    public function actionInfoAlter(&$actions)
-    {
-        if (\Drupal::moduleHandler()->moduleExists('pathauto')) {
-            $actions['pathauto_file_update_action'] = [
-                'type' => 'file',
-                'label' => $this->t('Update file alias'),
-                'configurable' => FALSE,
-            ];
-        }
+  }
+
+  /**
+   * Implements hook_action_info_alter().
+   */
+  #[Hook('action_info_alter')]
+  public function actionInfoAlter(&$actions) {
+    if (\Drupal::moduleHandler()->moduleExists('pathauto')) {
+      $actions['pathauto_file_update_action'] = [
+        'type' => 'file',
+        'label' => $this->t('Update file alias'),
+        'configurable' => FALSE,
+      ];
     }
-    /**
-     * Implements hook_field_formatter_info_alter().
-     */
-    #[Hook('field_formatter_info_alter')]
-    public function fieldFormatterInfoAlter(array &$info)
-    {
-        // Make the entity reference view formatter available for files and images.
-        if (!empty($info['entity_reference_entity_view'])) {
-            $info['entity_reference_entity_view']['field_types'][] = 'file';
-            $info['entity_reference_entity_view']['field_types'][] = 'image';
-        }
-        // Add descriptions to core formatters.
-        $descriptions = [
-            'file_default' => $this->t('Create a simple link to the file. The link is prefixed by a file type icon and the name of the file is used as the link text.'),
-            'file_table' => $this->t('Build a two-column table where the first column contains a generic link to the file and the second column displays the size of the file.'),
-            'file_url_plain' => $this->t('Display a plain text URL to the file.'),
-            'image' => $this->t('Format the file as an image. The image can be displayed using an image style and can optionally be linked to the image file itself or its parent content.'),
-        ];
-        foreach ($descriptions as $key => $description) {
-            if (isset($info[$key]) && empty($info[$key]['description'])) {
-                $info[$key]['description'] = $description;
-            }
-        }
+  }
+
+  /**
+   * Implements hook_field_formatter_info_alter().
+   */
+  #[Hook('field_formatter_info_alter')]
+  public function fieldFormatterInfoAlter(array &$info) {
+    // Make the entity reference view formatter available for files and images.
+    if (!empty($info['entity_reference_entity_view'])) {
+      $info['entity_reference_entity_view']['field_types'][] = 'file';
+      $info['entity_reference_entity_view']['field_types'][] = 'image';
     }
-    /**
-     * Implements hook_theme().
-     */
-    #[Hook('theme')]
-    public static function theme()
-    {
-        return [
-            'file' => [
-                'render element' => 'elements',
-                'template' => 'file',
-            ],
-            'file_entity_file_link' => [
-                'variables' => [
-                    'file' => NULL,
-                    'icon_directory' => NULL,
-                ],
-                'file' => 'file_entity.theme.inc',
-            ],
-            'file_entity_download_link' => [
-                'variables' => [
-                    'file' => NULL,
-                    'download_link' => NULL,
-                    'icon' => '',
-                    'file_size' => NULL,
-                    'attributes' => NULL,
-                ],
-            ],
-            'file_entity_audio' => [
-                'variables' => [
-                    'files' => [
-                    ],
-                    'attributes' => NULL,
-                ],
-            ],
-            'file_entity_video' => [
-                'variables' => [
-                    'files' => [
-                    ],
-                    'attributes' => NULL,
-                ],
-            ],
-        ];
+    // Add descriptions to core formatters.
+    $descriptions = [
+      'file_default' => $this->t('Create a simple link to the file. The link is prefixed by a file type icon and the name of the file is used as the link text.'),
+      'file_table' => $this->t('Build a two-column table where the first column contains a generic link to the file and the second column displays the size of the file.'),
+      'file_url_plain' => $this->t('Display a plain text URL to the file.'),
+      'image' => $this->t('Format the file as an image. The image can be displayed using an image style and can optionally be linked to the image file itself or its parent content.'),
+    ];
+    foreach ($descriptions as $key => $description) {
+      if (isset($info[$key]) && empty($info[$key]['description'])) {
+        $info[$key]['description'] = $description;
+      }
     }
-    /**
-     * Implements hook_entity_operation().
-     */
-    #[Hook('entity_operation')]
-    public function entityOperation(\Drupal\Core\Entity\EntityInterface $entity)
-    {
-        $operations = [
-        ];
-        if ($entity instanceof \Drupal\file_entity\Entity\FileEntity && $entity->access('download')) {
-            $operations['download'] = [
-                'title' => $this->t('Download'),
-                'weight' => 100,
-                'url' => $entity->downloadUrl(),
-            ];
-        }
-        return $operations;
+  }
+
+  /**
+   * Implements hook_theme().
+   */
+  #[Hook('theme')]
+  public static function theme() {
+    return [
+      'file' => [
+        'render element' => 'elements',
+        'template' => 'file',
+      ],
+      'file_entity_file_link' => [
+        'variables' => [
+          'file' => NULL,
+          'icon_directory' => NULL,
+        ],
+        'file' => 'file_entity.theme.inc',
+      ],
+      'file_entity_download_link' => [
+        'variables' => [
+          'file' => NULL,
+          'download_link' => NULL,
+          'icon' => '',
+          'file_size' => NULL,
+          'attributes' => NULL,
+        ],
+      ],
+      'file_entity_audio' => [
+        'variables' => [
+          'files' => [],
+          'attributes' => NULL,
+        ],
+      ],
+      'file_entity_video' => [
+        'variables' => [
+          'files' => [],
+          'attributes' => NULL,
+        ],
+      ],
+    ];
+  }
+
+  /**
+   * Implements hook_entity_operation().
+   */
+  #[Hook('entity_operation')]
+  public function entityOperation(EntityInterface $entity) {
+    $operations = [];
+    if ($entity instanceof FileEntity && $entity->access('download')) {
+      $operations['download'] = [
+        'title' => $this->t('Download'),
+        'weight' => 100,
+        'url' => $entity->downloadUrl(),
+      ];
     }
-    /**
-     * Implements hook_theme_suggestions_HOOK_alter().
-     */
-    #[Hook('theme_suggestions_file_alter')]
-    public static function themeSuggestionsFileAlter(array &$suggestions, array $variables)
-    {
-        $view_mode = $variables['view_mode'] = $variables['elements']['#view_mode'];
-        /** @var FileInterface $file */
-        $file = $variables['elements']['#file'];
-        // Clean up name so there are no underscores.
-        $suggestions[] = 'file__' . $file->bundle();
-        $suggestions[] = 'file__' . $file->bundle() . '__' . $view_mode;
-        $suggestions[] = 'file__' . str_replace([
-            '/',
-            '-',
-        ], [
-            '__',
-            '_',
-        ], $file->getMimeType());
-        $suggestions[] = 'file__' . str_replace([
-            '/',
-            '-',
-        ], [
-            '__',
-            '_',
-        ], $file->getMimeType()) . '__' . $view_mode;
-        $suggestions[] = 'file__' . $file->id();
-        $suggestions[] = 'file__' . $file->id() . '__' . $view_mode;
+    return $operations;
+  }
+
+  /**
+   * Implements hook_theme_suggestions_HOOK_alter().
+   */
+  #[Hook('theme_suggestions_file_alter')]
+  public static function themeSuggestionsFileAlter(array &$suggestions, array $variables) {
+    $view_mode = $variables['view_mode'] = $variables['elements']['#view_mode'];
+    /** @var \Drupal\file\Entity\FileInterface $file */
+    $file = $variables['elements']['#file'];
+    // Clean up name so there are no underscores.
+    $suggestions[] = 'file__' . $file->bundle();
+    $suggestions[] = 'file__' . $file->bundle() . '__' . $view_mode;
+    $suggestions[] = 'file__' . str_replace([
+      '/',
+      '-',
+    ], [
+      '__',
+      '_',
+    ], $file->getMimeType());
+    $suggestions[] = 'file__' . str_replace([
+      '/',
+      '-',
+    ], [
+      '__',
+      '_',
+    ], $file->getMimeType()) . '__' . $view_mode;
+    $suggestions[] = 'file__' . $file->id();
+    $suggestions[] = 'file__' . $file->id() . '__' . $view_mode;
+  }
+
+  /**
+   * Implements hook_file_download().
+   */
+  #[Hook('file_download')]
+  public static function fileDownload($uri) {
+    // Load the file from the URI.
+    $file = file_uri_to_object($uri);
+    // An existing file wasn't found, so we don't control access.
+    // E.g. image derivatives will fall here.
+    if (empty($file)) {
+      return NULL;
     }
-    /**
-     * Implements hook_file_download().
-     */
-    #[Hook('file_download')]
-    public static function fileDownload($uri)
-    {
-        // Load the file from the URI.
-        $file = file_uri_to_object($uri);
-        // An existing file wasn't found, so we don't control access.
-        // E.g. image derivatives will fall here.
-        if (empty($file)) {
-            return NULL;
-        }
-        // Allow the user to download the file if they have appropriate permissions.
-        if ($file->access('view')) {
-            return \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => $file->getDownloadHeaders(), fn() => file_get_content_headers($file));
-        }
-        return -1;
+    // Allow the user to download the file if they have appropriate permissions.
+    if ($file->access('view')) {
+      return DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => $file->getDownloadHeaders(), fn() => file_get_content_headers($file));
     }
-    /**
-     * @name pathauto_file Pathauto integration for the core file module.
-     * @{
-     */
-    /**
-     * Implements hook_entity_base_field_info().
-     */
-    #[Hook('entity_base_field_info')]
-    public function entityBaseFieldInfo(\Drupal\Core\Entity\EntityTypeInterface $entity_type)
-    {
-        // @todo: Make this configurable and/or remove if
-        //   https://drupal.org/node/476294 is resolved.
-        if (\Drupal::moduleHandler()->moduleExists('pathauto') && $entity_type->id() == 'file') {
-            $fields = [
-            ];
-            $fields['path'] = \Drupal\Core\Field\BaseFieldDefinition::create('path')->setCustomStorage(TRUE)->setLabel($this->t('URL alias'))->setTranslatable(TRUE)->setProvider('file_entity')->setDisplayOptions('form', [
-                'type' => 'path',
-                'weight' => 30,
-            ])->setDisplayConfigurable('form', TRUE);
-            return $fields;
-        }
+    return -1;
+  }
+
+  /**
+   * @name pathauto_file Pathauto integration for the core file module.
+   * @{
+   */
+
+  /**
+   * Implements hook_entity_base_field_info().
+   */
+  #[Hook('entity_base_field_info')]
+  public function entityBaseFieldInfo(EntityTypeInterface $entity_type) {
+    // @todo Make this configurable and/or remove if
+    //   https://drupal.org/node/476294 is resolved.
+    if (\Drupal::moduleHandler()->moduleExists('pathauto') && $entity_type->id() == 'file') {
+      $fields = [];
+      $fields['path'] = BaseFieldDefinition::create('path')->setCustomStorage(TRUE)->setLabel($this->t('URL alias'))->setTranslatable(TRUE)->setProvider('file_entity')->setDisplayOptions('form', [
+        'type' => 'path',
+        'weight' => 30,
+      ])->setDisplayConfigurable('form', TRUE);
+      return $fields;
     }
-    /**
-     * Implements hook_admin_menu_map().
-     */
-    #[Hook('admin_menu_map')]
-    public static function adminMenuMap()
-    {
-        if (!user_access('administer file types')) {
-            return;
-        }
-        $map['admin/structure/file-types/manage/%file_type'] = [
-            'parent' => 'admin/structure/file-types',
-            'arguments' => [
-                [
-                    '%file_type' => array_keys(file_entity_type_get_names()),
-                ],
-            ],
-        ];
-        return $map;
+  }
+
+  /**
+   * Implements hook_admin_menu_map().
+   */
+  #[Hook('admin_menu_map')]
+  public static function adminMenuMap() {
+    if (!user_access('administer file types')) {
+      return;
     }
-    /**
-     * Implements hook_entity_storage_load().
-     */
-    #[Hook('entity_storage_load')]
-    public static function entityStorageLoad($entities, $entity_type)
-    {
-        $token_service = \Drupal::token();
-        $replace_options = [
-            'clear' => TRUE,
-            'sanitize' => FALSE,
-        ];
-        $config = \Drupal::config('file_entity.settings');
-        // Loop over all the entities looking for entities with attached images.
-        foreach ($entities as $entity) {
-            // Skip non-fieldable entities.
-            if (!$entity instanceof \Drupal\Core\Entity\FieldableEntityInterface) {
-                continue;
-            }
-            /** @var \Drupal\Core\Entity\FieldableEntityInterface $entity */
-            // Examine every image field instance attached to this entity's bundle.
-            foreach ($entity->getFieldDefinitions() as $field_definition) {
-                if ($field_definition->getSetting('target_type') == 'file' && $field_definition->getType() != 'image') {
-                    $field_name = $field_definition->getName();
-                    if (!empty($entity->{$field_name})) {
-                        foreach ($entity->{$field_name} as $item) {
-                            // If alt and title text is not specified, fall back to alt and
-                            // title text on the file.
-                            if (!empty($item->target_id) && (empty($item->alt) || empty($item->title))) {
-                                foreach ([
-                                    'alt',
-                                    'title',
-                                ] as $key) {
-                                    if (empty($item->{$key})) {
-                                        $token_bubbleable_metadata = new \Drupal\Core\Render\BubbleableMetadata();
-                                        $item->{$key} = $token_service->replace($config->get($key), [
-                                            'file' => $item->entity,
-                                        ], $replace_options, $token_bubbleable_metadata);
-                                        // Add the cacheability metadata of the token to the entity.
-                                        // This means attachments are discarded, but it does not ever
-                                        // make sense to have attachments for an image's "alt" and
-                                        // "title"attribute anyway, so this is acceptable.
-                                        $entity->addCacheableDependency($token_bubbleable_metadata);
-                                    }
-                                }
-                            }
-                        }
-                    }
+    $map['admin/structure/file-types/manage/%file_type'] = [
+      'parent' => 'admin/structure/file-types',
+      'arguments' => [
+              [
+                '%file_type' => array_keys(file_entity_type_get_names()),
+              ],
+      ],
+    ];
+    return $map;
+  }
+
+  /**
+   * Implements hook_entity_storage_load().
+   */
+  #[Hook('entity_storage_load')]
+  public static function entityStorageLoad($entities, $entity_type) {
+    $token_service = \Drupal::token();
+    $replace_options = [
+      'clear' => TRUE,
+      'sanitize' => FALSE,
+    ];
+    $config = \Drupal::config('file_entity.settings');
+    // Loop over all the entities looking for entities with attached images.
+    foreach ($entities as $entity) {
+      // Skip non-fieldable entities.
+      if (!$entity instanceof FieldableEntityInterface) {
+        continue;
+      }
+      /** @var \Drupal\Core\Entity\FieldableEntityInterface $entity */
+      // Examine every image field instance attached to this entity's bundle.
+      foreach ($entity->getFieldDefinitions() as $field_definition) {
+        if ($field_definition->getSetting('target_type') == 'file' && $field_definition->getType() != 'image') {
+          $field_name = $field_definition->getName();
+          if (!empty($entity->{$field_name})) {
+            foreach ($entity->{$field_name} as $item) {
+              // If alt and title text is not specified, fall back to alt and
+              // title text on the file.
+              if (!empty($item->target_id) && (empty($item->alt) || empty($item->title))) {
+                foreach ([
+                  'alt',
+                  'title',
+                ] as $key) {
+                  if (empty($item->{$key})) {
+                    $token_bubbleable_metadata = new BubbleableMetadata();
+                    $item->{$key} = $token_service->replace($config->get($key), [
+                      'file' => $item->entity,
+                    ], $replace_options, $token_bubbleable_metadata);
+                    // Add the cacheability metadata of the token to the entity.
+                    // This means attachments are discarded, but it does not ever
+                    // make sense to have attachments for an image's "alt" and
+                    // "title"attribute anyway, so this is acceptable.
+                    $entity->addCacheableDependency($token_bubbleable_metadata);
+                  }
                 }
+              }
             }
+          }
         }
+      }
     }
-    /**
-     * Implements hook_preprocess_responsive_image_formatter().
-     */
-    #[Hook('preprocess_responsive_image_formatter')]
-    public static function preprocessResponsiveImageFormatter(&$variables)
-    {
-        if (empty($variables['responsive_image']['#width']) || empty($variables['responsive_image']['#height'])) {
-            foreach ([
-                'width',
-                'height',
-            ] as $key) {
-                $variables['responsive_image']["#{$key}"] = $variables['item']->entity->getMetadata($key);
-            }
-        }
-    }
-    /**
-     * Implements hook_preprocess_image_formatter().
-     */
-    #[Hook('preprocess_image_formatter')]
-    public static function preprocessImageFormatter(&$variables)
-    {
-        if (empty($variables['image']['#width']) || empty($variables['image']['#height'])) {
-            foreach ([
-                'width',
-                'height',
-            ] as $key) {
-                $variables['image']["#{$key}"] = $variables['item']->entity->getMetadata($key);
-            }
-        }
+  }
+
+  /**
+   * Implements hook_preprocess_responsive_image_formatter().
+   */
+  #[Hook('preprocess_responsive_image_formatter')]
+  public static function preprocessResponsiveImageFormatter(&$variables) {
+    if (empty($variables['responsive_image']['#width']) || empty($variables['responsive_image']['#height'])) {
+      foreach ([
+        'width',
+        'height',
+      ] as $key) {
+        $variables['responsive_image']["#{$key}"] = $variables['item']->entity->getMetadata($key);
+      }
     }
-    /**
-     * Implements hook_entity_bundle_info().
-     */
-    #[Hook('entity_bundle_info')]
-    public function entityBundleInfo()
-    {
-        // Define the undefined bundle for validation to work when the type is not
-        // yet known.
-        $bundles['file']['undefined']['label'] = $this->t('Unknown');
-        return $bundles;
+  }
+
+  /**
+   * Implements hook_preprocess_image_formatter().
+   */
+  #[Hook('preprocess_image_formatter')]
+  public static function preprocessImageFormatter(&$variables) {
+    if (empty($variables['image']['#width']) || empty($variables['image']['#height'])) {
+      foreach ([
+        'width',
+        'height',
+      ] as $key) {
+        $variables['image']["#{$key}"] = $variables['item']->entity->getMetadata($key);
+      }
     }
+  }
+
+  /**
+   * Implements hook_entity_bundle_info().
+   */
+  #[Hook('entity_bundle_info')]
+  public function entityBundleInfo() {
+    // Define the undefined bundle for validation to work when the type is not
+    // yet known.
+    $bundles['file']['undefined']['label'] = $this->t('Unknown');
+    return $bundles;
+  }
+
 }
diff --git a/src/Hook/FileEntityTokensHooks.php b/src/Hook/FileEntityTokensHooks.php
index 2bcba9b..48e43d4 100644
--- a/src/Hook/FileEntityTokensHooks.php
+++ b/src/Hook/FileEntityTokensHooks.php
@@ -5,133 +5,137 @@ namespace Drupal\file_entity\Hook;
 use Drupal\Core\Url;
 use Drupal\file_entity\Entity\FileType;
 use Drupal\Core\Render\BubbleableMetadata;
-use Drupal\Component\Utility\Html;
 use Drupal\Core\Hook\Attribute\Hook;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
+
 /**
  * Hook implementations for file_entity.
  */
-class FileEntityTokensHooks
-{
-    use StringTranslationTrait;
-    /**
-     * Implements hook_token_info().
-     */
-    #[Hook('token_info')]
-    public function tokenInfo()
-    {
-        // File type tokens.
-        $info['types']['file-type'] = [
-            'name' => $this->t('File type'),
-            'description' => $this->t('Tokens associated with file types.'),
-            'needs-data' => 'file_type',
-        ];
-        $info['tokens']['file-type']['name'] = [
-            'name' => $this->t('Name'),
-            'description' => $this->t('The name of the file type.'),
-        ];
-        $info['tokens']['file-type']['machine-name'] = [
-            'name' => $this->t('Machine-readable name'),
-            'description' => $this->t('The unique machine-readable name of the file type.'),
-        ];
-        $info['tokens']['file-type']['count'] = [
-            'name' => $this->t('File count'),
-            'description' => $this->t('The number of files belonging to the file type.'),
-        ];
-        $info['tokens']['file-type']['edit-url'] = [
-            'name' => $this->t('Edit URL'),
-            'description' => $this->t("The URL of the file type's edit page."),
-        ];
-        // File tokens.
-        $info['tokens']['file']['type'] = [
-            'name' => $this->t('File type'),
-            'description' => $this->t('The file type of the file.'),
-            'type' => 'file-type',
-        ];
-        $info['tokens']['file']['download-url'] = [
-            'name' => $this->t('Download URL'),
-            'description' => $this->t('The URL to download the file directly.'),
-            'type' => 'url',
-        ];
-        return $info;
+class FileEntityTokensHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_token_info().
+   */
+  #[Hook('token_info')]
+  public function tokenInfo() {
+    // File type tokens.
+    $info['types']['file-type'] = [
+      'name' => $this->t('File type'),
+      'description' => $this->t('Tokens associated with file types.'),
+      'needs-data' => 'file_type',
+    ];
+    $info['tokens']['file-type']['name'] = [
+      'name' => $this->t('Name'),
+      'description' => $this->t('The name of the file type.'),
+    ];
+    $info['tokens']['file-type']['machine-name'] = [
+      'name' => $this->t('Machine-readable name'),
+      'description' => $this->t('The unique machine-readable name of the file type.'),
+    ];
+    $info['tokens']['file-type']['count'] = [
+      'name' => $this->t('File count'),
+      'description' => $this->t('The number of files belonging to the file type.'),
+    ];
+    $info['tokens']['file-type']['edit-url'] = [
+      'name' => $this->t('Edit URL'),
+      'description' => $this->t("The URL of the file type's edit page."),
+    ];
+    // File tokens.
+    $info['tokens']['file']['type'] = [
+      'name' => $this->t('File type'),
+      'description' => $this->t('The file type of the file.'),
+      'type' => 'file-type',
+    ];
+    $info['tokens']['file']['download-url'] = [
+      'name' => $this->t('Download URL'),
+      'description' => $this->t('The URL to download the file directly.'),
+      'type' => 'url',
+    ];
+    return $info;
+  }
+
+  /**
+   * Implements hook_token_info_alter().
+   */
+  #[Hook('token_info_alter')]
+  public function tokenInfoAlter(&$info) {
+    $info['tokens']['file']['name']['description'] = $this->t('The name of the file.');
+  }
+
+  /**
+   * Implements hook_tokens().
+   */
+  #[Hook('tokens')]
+  public static function tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
+    $replacements = [];
+    $url_options = [
+      'absolute' => TRUE,
+    ];
+    if (isset($options['langcode'])) {
+      $langcode = $options['langcode'];
+      $url_options['language'] = \Drupal::languageManager()->getLanguage($langcode);
     }
-    /**
-     * Implements hook_token_info_alter().
-     */
-    #[Hook('token_info_alter')]
-    public function tokenInfoAlter(&$info)
-    {
-        $info['tokens']['file']['name']['description'] = $this->t('The name of the file.');
+    else {
+      $langcode = NULL;
     }
-    /**
-     * Implements hook_tokens().
-     */
-    #[Hook('tokens')]
-    public static function tokens($type, $tokens, array $data, array $options, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata)
-    {
-        $replacements = [
-        ];
-        $url_options = [
-            'absolute' => TRUE,
-        ];
-        if (isset($options['langcode'])) {
-            $langcode = $options['langcode'];
-            $url_options['language'] = \Drupal::languageManager()->getLanguage($langcode);
-        } else {
-            $langcode = NULL;
-        }
-        // File tokens.
-        if ($type == 'file' && !empty($data['file'])) {
-            $file = $data['file'];
-            foreach ($tokens as $name => $original) {
-                switch ($name) {
-                    case 'type':
-                        if ($file_type = \Drupal\file_entity\Entity\FileType::load($file->bundle())) {
-                            $bubbleable_metadata->addCacheableDependency($file_type);
-                            $replacements[$original] = $file_type->label();
-                        }
-                        break;
-                    case 'download-url':
-                        $replacements[$original] = $file->downloadUrl($url_options)->toString();
-                        break;
-                }
-            }
-            // Chained token relationships.
-            $token_service = \Drupal::service('token');
-            if (($file_type_tokens = $token_service->findWithPrefix($tokens, 'type')) && $file_type = \Drupal\file_entity\Entity\FileType::load($file->bundle())) {
-                $replacements += $token_service->generate('file-type', $file_type_tokens, [
-                    'file_type' => $file_type,
-                ], $options, $bubbleable_metadata);
-            }
-            if ($download_url_tokens = $token_service->findWithPrefix($tokens, 'download-url')) {
-                $replacements += $token_service->generate('url', $download_url_tokens, $file->downloadUrl()->toString(), $options, $bubbleable_metadata);
+    // File tokens.
+    if ($type == 'file' && !empty($data['file'])) {
+      $file = $data['file'];
+      foreach ($tokens as $name => $original) {
+        switch ($name) {
+          case 'type':
+            if ($file_type = FileType::load($file->bundle())) {
+              $bubbleable_metadata->addCacheableDependency($file_type);
+              $replacements[$original] = $file_type->label();
             }
+            break;
+
+          case 'download-url':
+            $replacements[$original] = $file->downloadUrl($url_options)->toString();
+            break;
         }
-        // File type tokens.
-        if ($type == 'file-type' && !empty($data['file_type'])) {
-            $file_type = $data['file_type'];
-            foreach ($tokens as $name => $original) {
-                switch ($name) {
-                    case 'name':
-                        $replacements[$original] = $file_type->label();
-                        break;
-                    case 'machine-name':
-                        // This is a machine name so does not ever need to be sanitized.
-                        $replacements[$original] = $file_type->id();
-                        break;
-                    case 'count':
-                        $query = \Drupal::database()->select('file_managed');
-                        $query->condition('type', $file_type->id());
-                        $query->addTag('file_type_file_count');
-                        $count = $query->countQuery()->execute()->fetchField();
-                        $replacements[$original] = (int) $count;
-                        break;
-                    case 'edit-url':
-                        $replacements[$original] = \Drupal\Core\Url::fromUri('admin/structure/file-types/manage/' . $file_type->type . '/fields', $url_options)->toString();
-                        break;
-                }
-            }
+      }
+      // Chained token relationships.
+      $token_service = \Drupal::service('token');
+      if (($file_type_tokens = $token_service->findWithPrefix($tokens, 'type')) && $file_type = FileType::load($file->bundle())) {
+        $replacements += $token_service->generate('file-type', $file_type_tokens, [
+          'file_type' => $file_type,
+        ], $options, $bubbleable_metadata);
+      }
+      if ($download_url_tokens = $token_service->findWithPrefix($tokens, 'download-url')) {
+        $replacements += $token_service->generate('url', $download_url_tokens, $file->downloadUrl()->toString(), $options, $bubbleable_metadata);
+      }
+    }
+    // File type tokens.
+    if ($type == 'file-type' && !empty($data['file_type'])) {
+      $file_type = $data['file_type'];
+      foreach ($tokens as $name => $original) {
+        switch ($name) {
+          case 'name':
+            $replacements[$original] = $file_type->label();
+            break;
+
+          case 'machine-name':
+            // This is a machine name so does not ever need to be sanitized.
+            $replacements[$original] = $file_type->id();
+            break;
+
+          case 'count':
+            $query = \Drupal::database()->select('file_managed');
+            $query->condition('type', $file_type->id());
+            $query->addTag('file_type_file_count');
+            $count = $query->countQuery()->execute()->fetchField();
+            $replacements[$original] = (int) $count;
+            break;
+
+          case 'edit-url':
+            $replacements[$original] = Url::fromUri('admin/structure/file-types/manage/' . $file_type->type . '/fields', $url_options)->toString();
+            break;
         }
-        return $replacements;
+      }
     }
+    return $replacements;
+  }
+
 }
diff --git a/src/Plugin/Field/FieldFormatter/FileImageResponsiveFormatter.php b/src/Plugin/Field/FieldFormatter/FileImageResponsiveFormatter.php
index 47417af..a642d21 100644
--- a/src/Plugin/Field/FieldFormatter/FileImageResponsiveFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/FileImageResponsiveFormatter.php
@@ -2,16 +2,13 @@
 
 namespace Drupal\file_entity\Plugin\Field\FieldFormatter;
 
+use Drupal\Component\Utility\DeprecationHelper;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter;
-use Drupal\Core\Entity\EntityStorageInterface;
-use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Drupal\Core\Session\AccountInterface;
-use Drupal\Core\Utility\LinkGeneratorInterface;
 
 /**
  * Plugin for responsive image formatter.
@@ -28,15 +25,16 @@ use Drupal\Core\Utility\LinkGeneratorInterface;
 class FileImageResponsiveFormatter extends ImageFormatter {
 
   /**
-   * @var EntityStorageInterface
+   * @var \Drupal\Core\Entity\EntityStorageInterface
    */
   protected $responsiveImageStyleStorage;
 
-  /*
+  /**
    * The image style entity storage.
    *
    * @var \Drupal\Core\Entity\EntityStorageInterface
    */
+
   protected $imageStyleStorage;
 
   /**
@@ -87,7 +85,7 @@ class FileImageResponsiveFormatter extends ImageFormatter {
 
     // Collect cache tags to be added for each item in the field.
     $responsive_image_style = $this->responsiveImageStyleStorage->load($this->getSetting('responsive_image_style'));
-    $image_styles_to_load = array();
+    $image_styles_to_load = [];
     $cache_tags = [];
     if ($responsive_image_style) {
       $cache_tags = Cache::mergeTags($cache_tags, $responsive_image_style->getCacheTags());
@@ -114,16 +112,25 @@ class FileImageResponsiveFormatter extends ImageFormatter {
       $item_attributes['loading'] = $image_loading_settings['attribute'] ?? 'lazy';
     }
 
-    $elements[] = array(
+    $elements[] = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => [
+      '#theme' => 'responsive_image_formatter',
+      '#item' => $item,
+      '#attributes' => $item_attributes,
+      '#responsive_image_style_id' => $responsive_image_style ? $responsive_image_style->id() : '',
+      '#url' => !empty($url) ? $url : NULL,
+      '#cache' => [
+        'tags' => $cache_tags,
+      ],
+    ], fn() => [
       '#theme' => 'responsive_image_formatter',
       '#item' => $item,
       '#item_attributes' => $item_attributes,
       '#responsive_image_style_id' => $responsive_image_style ? $responsive_image_style->id() : '',
       '#url' => !empty($url) ? $url : NULL,
-      '#cache' => array(
+      '#cache' => [
         'tags' => $cache_tags,
-      ),
-    );
+      ],
+    ]);
 
     return $elements;
   }
@@ -138,7 +145,7 @@ class FileImageResponsiveFormatter extends ImageFormatter {
    */
   public function settingsForm(array $form, FormStateInterface $form_state) {
     $elements = parent::settingsForm($form, $form_state);
-    $responsive_image_options = array();
+    $responsive_image_options = [];
     $responsive_image_styles = $this->responsiveImageStyleStorage->loadMultiple();
     if ($responsive_image_styles && !empty($responsive_image_styles)) {
       foreach ($responsive_image_styles as $machine_name => $responsive_image_style) {
@@ -148,17 +155,17 @@ class FileImageResponsiveFormatter extends ImageFormatter {
       }
     }
 
-    $elements['responsive_image_style'] = array(
+    $elements['responsive_image_style'] = [
       '#title' => t('Responsive image style'),
       '#type' => 'select',
       '#default_value' => $this->getSetting('responsive_image_style'),
       '#required' => TRUE,
       '#options' => $responsive_image_options,
-      '#description' => array(
+      '#description' => [
         '#markup' => $this->linkGenerator->generate($this->t('Configure Responsive Image Styles'), new Url('entity.responsive_image_style.collection')),
         '#access' => $this->currentUser->hasPermission('administer responsive image styles'),
-      ),
-    );
+      ],
+    ];
 
     unset($elements['image_link']['#options']['content']);
     unset($elements['image_style']);
@@ -173,11 +180,11 @@ class FileImageResponsiveFormatter extends ImageFormatter {
 
     $responsive_image_style = $this->responsiveImageStyleStorage->load($this->getSetting('responsive_image_style'));
     if ($responsive_image_style) {
-      $summary[] = t('Responsive image style: @responsive_image_style', array('@responsive_image_style' => $responsive_image_style->label()));
+      $summary[] = t('Responsive image style: @responsive_image_style', ['@responsive_image_style' => $responsive_image_style->label()]);
 
-      $link_types = array(
+      $link_types = [
         'file' => t('Linked to file'),
-      );
+      ];
       // Display this setting only if image is linked.
       if (isset($link_types[$this->getSetting('image_link')])) {
         $summary[] = $link_types[$this->getSetting('image_link')];
