Incorrect EntityType::$label_count type documentation

Created on 30 January 2022, almost 3 years ago
Updated 15 February 2023, almost 2 years ago

Problem/Motivation

I was building a class off entity type on a side project and PHPStan identified that label_count's type as not matching its usage. It is documented as a string but also documented as requiring keys and it is initialized with and expected to be an array.

  /**
   * A definite singular/plural name of the type.
   *
   * Needed keys: "singular" and "plural".
   *
   * @var string|\Drupal\Core\StringTranslation\TranslatableMarkup
   *
   * @see \Drupal\Core\Entity\EntityTypeInterface::getCountLabel()
   */
  protected $label_count = [];

Steps to reproduce

Fix documentation to specify it as an array.

Proposed resolution

Document it as an array.

Remaining tasks

User interface changes

n/a

API changes

n/a (aligning documentation with usage. protected.)

Data model changes

n/a

Release notes snippet

Doesn't seem like this is necessary.

πŸ› Bug report
Status

Fixed

Version

9.5

Component
EntityΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024