Add @method PhpDoc for EntityStorageInterface descendants

Created on 22 November 2022, over 1 year ago
Updated 30 January 2023, over 1 year 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 12 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.69.0 2024