Problem/Motivation

This is a follow up to answer a question asked by xjm in #3226716-14: Missing return value documentation for TranslatableInterface::addTranslation().

Is ContentEntityInterface was too specific, and if it should the return value be TranslatableRevisionableInterface in the following methods?

  • \Drupal\Core\TypedData\TranslatableInterface::getTranslation
  • \Drupal\Core\TypedData\TranslatableInterface::getUntranslated
  • \Drupal\Core\TypedData\TranslatableInterface::addTranslation

Steps to reproduce

Proposed resolution

Remaining tasks

Decide if a change is needed or not.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3269177

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

quietone created an issue. See original summary.

dieterholvoet’s picture

How about @return static? Makes sense, since 'The returned translation has to be of the same type than this typed data object.'. This would improve the results of static analysis and completions in editors like PhpStorm.

dieterholvoet’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Don't see any use with using static. The description below should be more then enough to all explain what is returned.

  • catch committed 95ab1941 on 10.1.x
    Issue #3269177 by DieterHolvoet, quietone, smustgrave: Should some...
catch’s picture

Version: 10.0.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.