InlineEntityFormBase::getEntityTypeLabels() has the wrong docblock

Created on 10 January 2024, 6 months ago
Updated 15 February 2024, 4 months ago

See InlineEntityFormBase::getEntityTypeLabels().

  /**
   * Gets the entity type managed by this handler.
   *
   * @return \Drupal\Core\Entity\EntityTypeInterface
   *   The entity type.
   */
  protected function getEntityTypeLabels() {
    // The admin has specified the exact labels that should be used.
    if ($this->getSetting('override_labels')) {
      return [
        'singular' => $this->getSetting('label_singular'),
        'plural' => $this->getSetting('label_plural'),
      ];
    }
    else {
      $this->createInlineFormHandler();
      return $this->inlineFormHandler->getEntityTypeLabels();
    }
  }

I was studying the code related to ๐Ÿ“Œ Remove hardcoded word 'entities' in EntityInlineForm::getEntityTypeLabels() Fixed when I noticed that the return type of this docblock is wrong. Then I noticed that it's just completely unrelated. I'm kind of surprised that PHPStan didn't pick up on this. It found other incorrect return types at level 1.

Anyone attempting to patch this should probably check the other functions in the class for the same problem. Maybe some docblocks accidentally got swapped or something.

๐Ÿ“Œ Task
Status

RTBC

Version

3.0

Component

Documentation

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States dcam

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024