From a2c775a65a0dbeed6e21f008307ca56291237d74 Mon Sep 17 00:00:00 2001
From: Erik Stielstra <40452-sutharsan@users.noreply.drupalcode.org>
Date: Mon, 30 Jan 2023 13:07:53 +0100
Subject: [PATCH] Issue #3337561 by Sutharsan: Fix code style issues

---
 src/BlockEntityStorage.php              | 2 +-
 src/Controller/FieldBlockController.php | 2 +-
 src/Form/FieldBlockConfigForm.php       | 4 ++--
 src/Plugin/Block/FieldBlock.php         | 8 ++++++--
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/BlockEntityStorage.php b/src/BlockEntityStorage.php
index 1de8c73..30e2f5b 100644
--- a/src/BlockEntityStorage.php
+++ b/src/BlockEntityStorage.php
@@ -10,7 +10,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
 
 /**
- * Class BlockEntityStorage.
+ * The entity storage for FieldBlocks.
  *
  * @package Drupal\fieldblock
  */
diff --git a/src/Controller/FieldBlockController.php b/src/Controller/FieldBlockController.php
index e67ccbf..a81d970 100644
--- a/src/Controller/FieldBlockController.php
+++ b/src/Controller/FieldBlockController.php
@@ -7,7 +7,7 @@ use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 
 /**
- * Class FieldBlockController.
+ * The FieldBlock controller.
  *
  * @package Drupal\fieldblock\Controller
  */
diff --git a/src/Form/FieldBlockConfigForm.php b/src/Form/FieldBlockConfigForm.php
index 013bd1c..f0c84ca 100644
--- a/src/Form/FieldBlockConfigForm.php
+++ b/src/Form/FieldBlockConfigForm.php
@@ -135,8 +135,8 @@ class FieldBlockConfigForm extends ConfigFormBase {
       $form['cleanup'] = [
         '#type' => 'checkboxes',
         '#required' => FALSE,
-        '#title' => t('Clean up remaining field blocks of removed entity types'),
-        '#description' => t('These entity types no longer exist, but one or more of their field blocks still do. Select the entity type(s) of which the field block(s) must be removed.'),
+        '#title' => $this->t('Clean up remaining field blocks of removed entity types'),
+        '#description' => $this->t('These entity types no longer exist, but one or more of their field blocks still do. Select the entity type(s) of which the field block(s) must be removed.'),
         '#default_value' => [],
         '#options' => $cleanup_options,
       ];
diff --git a/src/Plugin/Block/FieldBlock.php b/src/Plugin/Block/FieldBlock.php
index 3897972..394d800 100644
--- a/src/Plugin/Block/FieldBlock.php
+++ b/src/Plugin/Block/FieldBlock.php
@@ -62,7 +62,7 @@ class FieldBlock extends BlockBase implements ContainerFactoryPluginInterface {
   protected $routeMatch;
 
   /**
-   * The language manager
+   * The language manager.
    *
    * @var \Drupal\Core\Language\LanguageManagerInterface
    */
@@ -92,6 +92,8 @@ class FieldBlock extends BlockBase implements ContainerFactoryPluginInterface {
    *   The field formatter plugin manager.
    * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
    *   The current route match.
+   * @param \Drupal\Core\Language\LanguageManagerInterface $languageManager
+   *   The language manager.
    */
   public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entityTypeManager, EntityFieldManagerInterface $entityFieldManager, FormatterPluginManager $formatter_plugin_manager, RouteMatchInterface $route_match, LanguageManagerInterface $languageManager) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
@@ -395,11 +397,13 @@ class FieldBlock extends BlockBase implements ContainerFactoryPluginInterface {
   }
 
   /**
-   * Ensure that the field gets correctly translated into the current language
+   * Ensure that the field gets correctly translated into the current language.
    *
    * @param \Drupal\Core\Entity\ContentEntityInterface $entity
+   *   The entity that contains the field.
    *
    * @return \Drupal\Core\Field\FieldItemListInterface
+   *   The field in the current language.
    */
   private function getTranslatedFieldFromEntity(ContentEntityInterface $entity) {
     $language = $this->languageManager->getCurrentLanguage()->getId();
-- 
GitLab