From b28613324ae64152824fd76fb020fcff210b1f42 Mon Sep 17 00:00:00 2001
From: xjm <xjm@65776.no-reply.drupal.org>
Date: Mon, 4 May 2020 13:02:41 -0500
Subject: [PATCH] Issue #3112328 by jungle, hash6, xjm: FormatterBase
 implements ContainerFactoryPluginInterface, so it's not necessary for its
 child classes to repeat that they do as well

---
 .../Field/FieldFormatter/EntityReferenceEntityFormatter.php    | 3 +--
 .../Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php | 3 +--
 .../Plugin/Field/FieldFormatter/TimestampAgoFormatter.php      | 3 +--
 .../Field/Plugin/Field/FieldFormatter/TimestampFormatter.php   | 3 +--
 .../Plugin/Field/FieldFormatter/CommentDefaultFormatter.php    | 3 +--
 .../Field/FieldFormatter/ContentModerationStateFormatter.php   | 3 +--
 .../src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php  | 3 +--
 .../image/src/Plugin/Field/FieldFormatter/ImageFormatter.php   | 3 +--
 .../link/src/Plugin/Field/FieldFormatter/LinkFormatter.php     | 3 +--
 .../media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php  | 3 +--
 .../Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php   | 3 +--
 11 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index 09fa8ec0b099..8474b99eee91 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
@@ -8,7 +8,6 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Logger\LoggerChannelFactoryInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -23,7 +22,7 @@
  *   }
  * )
  */
-class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase implements ContainerFactoryPluginInterface {
+class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase {
 
   /**
    * The number of times this formatter allows rendering the same entity.
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php
index ef2f43c283e9..47c2fc08c4f8 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php
@@ -9,7 +9,6 @@
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -27,7 +26,7 @@
  *   }
  * )
  */
-class StringFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
+class StringFormatter extends FormatterBase {
 
   /**
    * The entity type manager.
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampAgoFormatter.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampAgoFormatter.php
index e4c3d9171e2e..c5b39942b3f7 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampAgoFormatter.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampAgoFormatter.php
@@ -10,7 +10,6 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -27,7 +26,7 @@
  *   }
  * )
  */
-class TimestampAgoFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
+class TimestampAgoFormatter extends FormatterBase {
 
   /**
    * The date formatter service.
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php
index cbc6d7ddd55a..deb1e1aca366 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php
@@ -8,7 +8,6 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -24,7 +23,7 @@
  *   }
  * )
  */
-class TimestampFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
+class TimestampFormatter extends FormatterBase {
 
   /**
    * The date formatter service.
diff --git a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
index c89a48c341fe..35ce99b7ebe4 100644
--- a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
+++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
@@ -12,7 +12,6 @@
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FormatterBase;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -31,7 +30,7 @@
  *   }
  * )
  */
-class CommentDefaultFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
+class CommentDefaultFormatter extends FormatterBase {
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/content_moderation/src/Plugin/Field/FieldFormatter/ContentModerationStateFormatter.php b/core/modules/content_moderation/src/Plugin/Field/FieldFormatter/ContentModerationStateFormatter.php
index 5d4c2b7bf6ab..3a3c5c6409a4 100644
--- a/core/modules/content_moderation/src/Plugin/Field/FieldFormatter/ContentModerationStateFormatter.php
+++ b/core/modules/content_moderation/src/Plugin/Field/FieldFormatter/ContentModerationStateFormatter.php
@@ -6,7 +6,6 @@
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -20,7 +19,7 @@
  *   }
  * )
  */
-class ContentModerationStateFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
+class ContentModerationStateFormatter extends FormatterBase {
 
   /**
    * The moderation information service.
diff --git a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php
index 272cb9ea1ec1..c7b66c70824f 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php
@@ -9,7 +9,6 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -17,7 +16,7 @@
 /**
  * Base class for 'DateTime Field formatter' plugin implementations.
  */
-abstract class DateTimeFormatterBase extends FormatterBase implements ContainerFactoryPluginInterface {
+abstract class DateTimeFormatterBase extends FormatterBase {
 
   /**
    * The date formatter service.
diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
index ee99b0f87b59..e350e53529ce 100644
--- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
+++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
@@ -6,7 +6,6 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Link;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Url;
 use Drupal\image\Entity\ImageStyle;
@@ -28,7 +27,7 @@
  *   }
  * )
  */
-class ImageFormatter extends ImageFormatterBase implements ContainerFactoryPluginInterface {
+class ImageFormatter extends ImageFormatterBase {
 
   /**
    * The current user.
diff --git a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
index b0928b0db000..83f1a2f27053 100644
--- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
+++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
@@ -8,7 +8,6 @@
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Path\PathValidatorInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Url;
 use Drupal\link\LinkItemInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -24,7 +23,7 @@
  *   }
  * )
  */
-class LinkFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
+class LinkFormatter extends FormatterBase {
 
   /**
    * The path validator service.
diff --git a/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php b/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php
index c08c84f40ab2..0c9229b4e2be 100644
--- a/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php
+++ b/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php
@@ -10,7 +10,6 @@
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Logger\LoggerChannelFactoryInterface;
 use Drupal\Core\Messenger\MessengerInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Url;
 use Drupal\media\Entity\MediaType;
 use Drupal\media\IFrameUrlHelper;
@@ -38,7 +37,7 @@
  *   },
  * )
  */
-class OEmbedFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
+class OEmbedFormatter extends FormatterBase {
 
   /**
    * The messenger service.
diff --git a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
index dcd059cf7779..eea85be8725d 100644
--- a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
+++ b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
@@ -7,7 +7,6 @@
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Url;
 use Drupal\file\FileInterface;
 use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatterBase;
@@ -30,7 +29,7 @@
  *   }
  * )
  */
-class ResponsiveImageFormatter extends ImageFormatterBase implements ContainerFactoryPluginInterface {
+class ResponsiveImageFormatter extends ImageFormatterBase {
 
   /**
    * @var \Drupal\Core\Entity\EntityStorageInterface
-- 
GitLab