From 32aa17d025a5ef786b9fcf80fa9f931b65438f64 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 23 Apr 2024 00:49:09 +0100
Subject: [PATCH] Issue #3442693 by catch, smustgrave: Remove deprecated code
 from path_alias module

---
 core/modules/path_alias/src/AliasManager.php | 75 ++------------------
 1 file changed, 5 insertions(+), 70 deletions(-)

diff --git a/core/modules/path_alias/src/AliasManager.php b/core/modules/path_alias/src/AliasManager.php
index 8651a767c96a..9a72d2eaa4d6 100644
--- a/core/modules/path_alias/src/AliasManager.php
+++ b/core/modules/path_alias/src/AliasManager.php
@@ -12,20 +12,6 @@
  */
 class AliasManager implements AliasManagerInterface {
 
-  /**
-   * The path alias repository.
-   *
-   * @var \Drupal\path_alias\AliasRepositoryInterface
-   */
-  protected $pathAliasRepository;
-
-  /**
-   * Cache backend service.
-   *
-   * @var \Drupal\Core\Cache\CacheBackendInterface
-   */
-  protected $cache;
-
   /**
    * The cache key to use when caching paths.
    *
@@ -40,13 +26,6 @@ class AliasManager implements AliasManagerInterface {
    */
   protected $cacheNeedsWriting = FALSE;
 
-  /**
-   * Language manager for retrieving the default langcode when none is specified.
-   *
-   * @var \Drupal\Core\Language\LanguageManagerInterface
-   */
-  protected $languageManager;
-
   /**
    * Holds the map of path lookups per language.
    *
@@ -61,13 +40,6 @@ class AliasManager implements AliasManagerInterface {
    */
   protected $noPath = [];
 
-  /**
-   * Holds the array of whitelisted path aliases.
-   *
-   * @var \Drupal\path_alias\AliasWhitelistInterface
-   */
-  protected $whitelist;
-
   /**
    * Holds an array of paths that have no alias.
    *
@@ -92,35 +64,13 @@ class AliasManager implements AliasManagerInterface {
    */
   protected $preloadedPathLookups = FALSE;
 
-  /**
-   * Constructs an AliasManager.
-   *
-   * @param \Drupal\path_alias\AliasRepositoryInterface $alias_repository
-   *   The path alias repository.
-   * @param \Drupal\path_alias\AliasWhitelistInterface $whitelist
-   *   The whitelist implementation to use.
-   * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
-   *   The language manager.
-   * @param \Drupal\Core\Cache\CacheBackendInterface $cache
-   *   Cache backend.
-   * @param \Drupal\Component\Datetime\TimeInterface|null $time
-   *   The time service.
-   */
   public function __construct(
-    AliasRepositoryInterface $alias_repository,
-    AliasWhitelistInterface $whitelist,
-    LanguageManagerInterface $language_manager,
-    CacheBackendInterface $cache,
-    protected ?TimeInterface $time = NULL,
+    protected AliasRepositoryInterface $pathAliasRepository,
+    protected AliasWhitelistInterface $whitelist,
+    protected LanguageManagerInterface $languageManager,
+    protected CacheBackendInterface $cache,
+    protected TimeInterface $time,
   ) {
-    $this->pathAliasRepository = $alias_repository;
-    $this->languageManager = $language_manager;
-    $this->whitelist = $whitelist;
-    $this->cache = $cache;
-    if (!$time) {
-      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3387233', E_USER_DEPRECATED);
-      $this->time = \Drupal::service(TimeInterface::class);
-    }
   }
 
   /**
@@ -300,19 +250,4 @@ protected function pathAliasWhitelistRebuild($path = NULL) {
     $this->whitelist->clear();
   }
 
-  /**
-   * Wrapper method for REQUEST_TIME constant.
-   *
-   * @return int
-   *
-   * @deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use
-   *   the $this->time->getRequestTime() service instead.
-   *
-   * @see https://www.drupal.org/node/3387233
-   */
-  protected function getRequestTime() {
-    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use the $this->time->getRequestTime() instead. See https://www.drupal.org/node/3387233', E_USER_DEPRECATED);
-    return $this->time->getRequestTime();
-  }
-
 }
-- 
GitLab