From 1d93843f6afda32a9eeb22a798a41060ad825dcc Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Mon, 18 Oct 2021 12:05:28 +0100
Subject: [PATCH] Issue #3110580 by ankithashetty, init90,
 Sivaji_Ganesh_Jojodae, longwave: Resolve @todo - remove ::processOutbound()
 when we remove UrlGenerator::fromPath()

---
 core/core.services.yml                        |  1 -
 .../Core/PathProcessor/PathProcessorFront.php | 16 +------------
 .../PathProcessor/PathProcessorFrontTest.php  | 23 -------------------
 3 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/core/core.services.yml b/core/core.services.yml
index 4da78a00d721..0fa5ab98a3a2 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -1351,7 +1351,6 @@ services:
     class: Drupal\Core\PathProcessor\PathProcessorFront
     tags:
       - { name: path_processor_inbound, priority: 200 }
-      - { name: path_processor_outbound, priority: 200 }
     arguments: ['@config.factory']
   route_processor_current:
     class: Drupal\Core\RouteProcessor\RouteProcessorCurrent
diff --git a/core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php b/core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php
index 8045dd371b4d..1136de701f2d 100644
--- a/core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php
+++ b/core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php
@@ -3,16 +3,13 @@
 namespace Drupal\Core\PathProcessor;
 
 use Drupal\Core\Config\ConfigFactoryInterface;
-use Drupal\Core\Render\BubbleableMetadata;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Processes the inbound path by resolving it to the front page if empty.
- *
- * @todo - remove ::processOutbound() when we remove UrlGenerator::fromPath().
  */
-class PathProcessorFront implements InboundPathProcessorInterface, OutboundPathProcessorInterface {
+class PathProcessorFront implements InboundPathProcessorInterface {
 
   /**
    * A config factory for retrieving required config settings.
@@ -56,15 +53,4 @@ public function processInbound($path, Request $request) {
     return $path;
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
-    // The special path '<front>' links to the default front page.
-    if ($path === '/<front>') {
-      $path = '/';
-    }
-    return $path;
-  }
-
 }
diff --git a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php
index eac05d59f337..df82584fa4ff 100644
--- a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php
+++ b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php
@@ -68,27 +68,4 @@ public function testProcessInboundBadConfig() {
     $processor->processInbound('/', new Request());
   }
 
-  /**
-   * Tests basic outbound processing functionality.
-   *
-   * @covers ::processOutbound
-   * @dataProvider providerProcessOutbound
-   */
-  public function testProcessOutbound($path, $expected) {
-    $config_factory = $this->prophesize(ConfigFactoryInterface::class);
-    $processor = new PathProcessorFront($config_factory->reveal());
-    $this->assertEquals($expected, $processor->processOutbound($path));
-  }
-
-  /**
-   * Outbound paths and expected results.
-   */
-  public function providerProcessOutbound() {
-    return [
-      ['/<front>', '/'],
-      ['<front>', '<front>'],
-      ['/user', '/user'],
-    ];
-  }
-
 }
-- 
GitLab