Commit 6490cf4e authored by Damien McKenna's avatar Damien McKenna Committed by Damien McKenna
Browse files

Issue #3305751 by DamienMcKenna: Fix coding standards issues.

parent 4369ba4e
Loading
Loading
Loading
Loading
+2 −4
Changes for metatag.module: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -421,16 +421,14 @@ function metatag_get_route_entity() {
  // one bundle and it's named the same as the entity type, so some shortcuts
  // can be used.
  if ($route_name == 'user.admin_create') {
    $entity_type = $type = 'user';
    $entity_type = 'user';
    $definition = Drupal::entityTypeManager()->getDefinition($entity_type);
    if (!empty($type)) {
    return \Drupal::entityTypeManager()
      ->getStorage($entity_type)
      ->create([
          $definition->get('entity_keys')['bundle'] => $type,
        $definition->get('entity_keys')['bundle'] => $entity_type,
      ]);
  }
  }

  // Trigger hook_metatag_route_entity().
  if ($entities = \Drupal::moduleHandler()->invokeAll('metatag_route_entity', [$route_match])) {
+2 −0
Changes for metatag_favicons/src/Plugin/metatag/Tag/MaskIcon.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ class MaskIcon extends LinkRelBase {

      return $element;
    }

    return '';
  }

  /**
+4 −2
Changes for src/Form/MetatagDefaultsForm.php: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ class MetatagDefaultsForm extends EntityForm {
    $form['#suffix'] = '</div>';

    $default_type = NULL;
    if (!empty($metatag_defaults)) {
    if ($metatag_defaults) {
      $default_type = $metatag_defaults->getOriginalId();
    }
    else {
@@ -289,6 +289,7 @@ class MetatagDefaultsForm extends EntityForm {
    ksort($tag_values);

    $metatag_defaults->set('tags', $tag_values);
    /** @var int $status */
    $status = $metatag_defaults->save();

    switch ($status) {
@@ -305,7 +306,8 @@ class MetatagDefaultsForm extends EntityForm {
    }

    $form_state->setRedirectUrl($metatag_defaults->toUrl('collection'));
    // @todo This is expected to return an INT value.

    return $status;
  }

  /**
+1 −0
Changes for src/Form/MetatagDefaultsRevertForm.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ class MetatagDefaultsRevertForm extends EntityConfirmFormBase {
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    /** @var \Drupal\metatag\Entity\MetatagDefaults $this->entity */
    $this->entity->revert();

    $this->messenger()->addMessage(
+12 −1
Changes for src/MetatagDefaultsListBuilder.php: 12 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -28,7 +28,16 @@ class MetatagDefaultsListBuilder extends ConfigEntityListBuilder {
    $entity_ids = $query->execute();

    // Load global entity always.
    return $entity_ids + $this->getParentIds($entity_ids);
    $parents = $this->getParentIds($entity_ids);
    if (!empty($parents)) {
      if (empty($entity_ids)) {
        $entity_ids = $parents;
      }
      else {
        $entity_ids = array_merge($entity_ids, $parents);
      }
    }
    return $entity_ids;
  }

  /**
@@ -67,6 +76,7 @@ class MetatagDefaultsListBuilder extends ConfigEntityListBuilder {
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    /** @var \Drupal\metatag\Entity\MetatagDefaults $entity */
    $row['label'] = $this->getLabelAndConfig($entity);
    $row['status'] = $entity->status() ? $this->t('Active') : $this->t('Disabled');
    return $row + parent::buildRow($entity);
@@ -101,6 +111,7 @@ class MetatagDefaultsListBuilder extends ConfigEntityListBuilder {
   *   Render array for a table cell.
   */
  public function getLabelAndConfig(EntityInterface $entity) {
    /** @var \Drupal\metatag\Entity\MetatagDefaults $entity */
    $output = '<div>';
    $prefix = '';
    $inherits = '';
Loading