diff --git a/src/BlockEntityStorage.php b/src/BlockEntityStorage.php index 1de8c73ec234864df707c3adcab819c7ad7c5443..30e2f5b29bfb116a92dc2b72b8d23d27abe1369d 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 e67ccbf444abf170095e959cedf9056fc9f88a8f..a81d970bb5b2fad6b0fe1d1d3758526300b4e376 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 013bd1c466b31cdb85f243d7b4c649a01c13aa8a..f0c84cab443952e0bcd265532241cce21c5762c4 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 389797238e2156375eb1cecfd90f5ac524e06dfd..394d800da999ec413dca7b7119ff31050555a5f1 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();