From f182e9d21684ce9e060f58b1d7bee27e91d6131f Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Wed, 11 Jan 2017 11:25:29 +0000
Subject: [PATCH] =?UTF-8?q?Issue=20#2841542=20by=20Wim=20Leers:=20\Drupal\?=
 =?UTF-8?q?serialization\EventSubscriber\UserRouteAlterSubscriber=20has=20?=
 =?UTF-8?q?serializer=20service=20injected,=20but=20doesn't=20use=20it=20?=
 =?UTF-8?q?=E2=80=94=20also=20makes=20route=20rebuilding=20more=20expensiv?=
 =?UTF-8?q?e?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../serialization/serialization.services.yml        |  2 +-
 .../EventSubscriber/UserRouteAlterSubscriber.php    | 13 +------------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/core/modules/serialization/serialization.services.yml b/core/modules/serialization/serialization.services.yml
index cfb71adcf99e..c8fb3767f7e2 100644
--- a/core/modules/serialization/serialization.services.yml
+++ b/core/modules/serialization/serialization.services.yml
@@ -88,4 +88,4 @@ services:
     class: Drupal\serialization\EventSubscriber\UserRouteAlterSubscriber
     tags:
       - { name: event_subscriber }
-    arguments: ['@serializer', '%serializer.formats%']
+    arguments: ['%serializer.formats%']
diff --git a/core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php b/core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php
index 013402c5c383..2d5d78fbf7e4 100644
--- a/core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php
+++ b/core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php
@@ -5,20 +5,12 @@
 use Drupal\Core\Routing\RouteBuildEvent;
 use Drupal\Core\Routing\RoutingEvents;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\Serializer\SerializerInterface;
 
 /**
  * Alters user authentication routes to support additional serialization formats.
  */
 class UserRouteAlterSubscriber implements EventSubscriberInterface {
 
-  /**
-   * The serializer.
-   *
-   * @var \Symfony\Component\Serializer\Serializer
-   */
-  protected $serializer;
-
   /**
    * The available serialization formats.
    *
@@ -29,13 +21,10 @@ class UserRouteAlterSubscriber implements EventSubscriberInterface {
   /**
    * UserRouteAlterSubscriber constructor.
    *
-   * @param \Symfony\Component\Serializer\SerializerInterface $serializer
-   *   The serializer service.
    * @param array $serializer_formats
    *   The available serializer formats.
    */
-  public function __construct(SerializerInterface $serializer, array $serializer_formats) {
-    $this->serializer = $serializer;
+  public function __construct(array $serializer_formats) {
     $this->serializerFormats = $serializer_formats;
   }
 
-- 
GitLab