Add @method PhpDoc for EntityStorageInterface descendants

Created on 22 November 2022, almost 2 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

With the current typehinting an IDE can't provide proper autocompletions for methods and other inspections.

Steps to reproduce

class C1 {
  protected \Drupal\node\NodeStorageInterface $nodeStorage;

  public function m1() {
    foreach ($this->nodeStorage->loadMultiple() as $node) {
      $node->isPromoted();
    }
  }
}

The problem is that several method signature are defined in the EntityStorageInterface or ConfigEntityStorageInterface or ContentEntityStorageInterface.
The implementer classes use {@inheritdoc} for ::load() and for other methods as well.
That means an IDE still thinks that the return value of a NodeStorageInterface::load() is null|EntityInterface instead of null|NodeInterface
That is why an IDE can't provide more accurate help.

Proposed resolution

Add @method PhpDoc entries for every EntityStorageInterface descendants.

πŸ“Œ Task
Status

Postponed

Version

10.1 ✨

Component
DocumentationΒ  β†’

Last updated about 2 hours ago

No maintainer
Created by

πŸ‡­πŸ‡ΊHungary Sweetchuck Budapest

Live updates comments and jobs are added and updated live.
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