Document field item properties with @property doc

Created on 11 August 2017, over 7 years ago
Updated 30 January 2023, almost 2 years ago

Field item properties can be accessed via magic method.
This is thanks to FieldItemBase::__get().

IMO, magic __get() is only useful if the IDE can determine the return type.

Fortunately this is easy to achieve. E.g. like this on EntityReferenceItem:

namespace Drupal\Core\Field\Plugin\Field\FieldType;
[..]
/**
[..]
 *
 * @property string|int $target_id
 * @property EntityInterface $entity
 */
class EntityReferenceItem [..] {

There are probably more magic __get() in other places. But for this issue let us focus on field items.

📌 Task
Status

Needs work

Version

10.1

Component
Field 

Last updated 2 days ago

Created by

🇩🇪Germany donquixote

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

Not all content is available!

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

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • 🇮🇳India _utsavsharma

    Patch for 10.1.x.

  • Status changed to Needs review 3 months ago
  • 🇬🇧United Kingdom rachel_norfolk UK

    Marking as Needs Review by a budding first time contributor at DrupalCon...

  • 🇺🇸United States smustgrave

    Thanks for picking up! And hope DrupalCon barcelona is going well!

    So issues should follow the standard issue template (can find it by creating a new issue and copying that summary)

    Also fixes should be in MRs vs patches so that tests may run.

    Feel free to keep working just marking with the DrupalCon message.

    Novice issue reserved for the Mentored Contribution during DrupalCon Barcelona 2024. After the 27th of September 2024, this issue returns to being open to all. Thanks

  • 🇬🇧United Kingdom jacobupal Leeds

    Our table is working on this!

  • First commit to issue fork.
  • Merge request !9633Resolve #2901435 "Document field item" → (Open) created by bramr
  • Pipeline finished with Success
    3 months ago
    Total: 399s
    #294178
  • 🇬🇧United Kingdom jacobupal Leeds

    This needs to be reviewed by somebody who knows fields because now the patches have been re-rolled and turned into a merge request we can't actually confirm that the the types and identifiers present in the annotation are correct or correspond correctly with the associated field types.

    I'm also removing the novice tag, as this has moved far beyond novice!

  • 🇺🇸United States smustgrave

    Issue summary should probably be updated some as template appears to be incomplete and maybe missing some relevant sections from the default issue summary template.

Production build 0.71.5 2024