There's a lot of methods in service but most of doc-blocks are have no type hinting

Files: 
CommentFileSizeAuthor
#23 drupal_2092265_23.patch5.74 KBXano
PASSED: [[SimpleTest]]: [MySQL] 59,103 pass(es).
[ View ]
#23 interdiff.txt3.33 KBXano
#20 drupal8.field-system.2092265-19.patch4.64 KBamateescu
PASSED: [[SimpleTest]]: [MySQL] 58,687 pass(es).
[ View ]
#19 drupal_2092265_19.patch5.27 KBXano
PASSED: [[SimpleTest]]: [MySQL] 59,292 pass(es).
[ View ]
#12 interdiff.txt548 bytesandypost
#12 drupal8.field-system.2092265-12.patch5.26 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 59,231 pass(es).
[ View ]
#11 interdiff.txt763 bytesandypost
#11 drupal8.field-system.2092265-11.patch4.97 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 59,149 pass(es).
[ View ]
#9 interdiff.txt1.07 KBandypost
#9 drupal8.field-system.2092265-9.patch4.92 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 59,297 pass(es).
[ View ]
#7 drupal8.field-system.2092265-7.patch4.82 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 59,167 pass(es).
[ View ]
#1 drupal8.field-system.2092265-1.patch5.45 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 59,775 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new5.45 KB
PASSED: [[SimpleTest]]: [MySQL] 59,775 pass(es).
[ View ]

Initial patch

+++ b/core/modules/field/lib/Drupal/field/FieldInfo.php
@@ -218,7 +220,7 @@ public function getFieldMap() {
+   * @return \Drupal\field\FieldInterface[]

Never saw that syntax before, but it seems we start to use it in other places in core... Is that an offical doc standard now ?

Status:Needs review» Reviewed & tested by the community

Wow, Phpstorm actually recognizes this and provides method completion accordingly, that's pretty awesome :-)

@yched yes same here, but dawehner suggested this syntax

Status:Reviewed & tested by the community» Needs work
Issue tags:+Needs reroll

Patch no longer applies.

Status:Needs work» Needs review
Issue tags:-Needs reroll
StatusFileSize
new4.82 KB
PASSED: [[SimpleTest]]: [MySQL] 59,167 pass(es).
[ View ]

prepareExtraFields() is gone
Also removed useless

use Drupal\field\FieldInterface;
use Drupal\field\FieldInstanceInterface;

because they are in the same namespace

Status:Needs review» Needs work
  1. +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php
    @@ -256,10 +256,10 @@ public function getFields() {
    -   * @return
    +   * @return \Drupal\field\FieldInstanceInterface[]
        *   If $entity_type is not set, all instances keyed by entity type and bundle
        *   name. If $entity_type is set, all instances for that entity type, keyed
        *   by bundle name.

    FieldInstanceInterface[] is not correct, unfortunately, see the description of the @return . The current (arguably bad DX) behavior of the function is to have different return structure depending on the params

  2. +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php
    @@ -508,7 +508,7 @@ public function getBundleInstances($entity_type, $bundle) {
    +   * @return \Drupal\field\FieldInstanceInterface|NULL
        *   An associative array of instance data for the specific field and bundle;
        *   NULL if the instance does not exist.

    The description for the @return is totally invalid now - an $instance structure is not an associative array anymore. Could we fix that while we're in here ?

Status:Needs work» Needs review
StatusFileSize
new4.92 KB
PASSED: [[SimpleTest]]: [MySQL] 59,297 pass(es).
[ View ]
new1.07 KB

Nice catch!

Thanks for being so quick !
Sorry, actually the main description for the getInstance() method is similarly badly outdated :-/

+++ b/core/modules/field/lib/Drupal/field/FieldInfo.php
@@ -509,7 +509,7 @@ public function getBundleInstances($entity_type, $bundle) {
+   *   The instance definition for the specific field of the entity bundle;

Awkward phrasing. Maybe just "The field instance definition, or NULL if it does not exist" ?

StatusFileSize
new4.97 KB
PASSED: [[SimpleTest]]: [MySQL] 59,149 pass(es).
[ View ]
new763 bytes

@yched you awesome as always!

StatusFileSize
new5.26 KB
PASSED: [[SimpleTest]]: [MySQL] 59,231 pass(es).
[ View ]
new548 bytes

yched> andypost: the first line of the phpdoc for getInstance() should be fixed as well :-)
yched> andypost: "Returns an array of instance data..." -> "Returns a field instance definition."

Status:Needs review» Reviewed & tested by the community

Yay :-)
Thanks !

The last submitted patch, drupal8.field-system.2092265-12.patch, failed testing.

Status:Needs work» Needs review
Issue tags:+DX (Developer Experience), +Field API

Status:Needs review» Reviewed & tested by the community

Some strange failure of upgrade tests has happen

Issue tags:+documentation

tagging

Status:Reviewed & tested by the community» Needs work
Issue tags:+Needs reroll

Patch no longer applies.

Status:Needs work» Needs review
Issue tags:-Needs reroll
StatusFileSize
new5.27 KB
PASSED: [[SimpleTest]]: [MySQL] 59,292 pass(es).
[ View ]

Re-roll, and I fixed some more type hints in code comments. I just don't know how to interdiff if there's a patch that no longer applies.

Status:Needs review» Reviewed & tested by the community
Issue tags:-DX (Developer Experience), -Field API
StatusFileSize
new4.64 KB
PASSED: [[SimpleTest]]: [MySQL] 58,687 pass(es).
[ View ]

Here it is.

  1. +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php
    @@ -344,10 +344,10 @@ public function getField($entity_type, $field_name) {
    -   * @return
    +   * @return \Drupal\field\FieldInterface|NULL

    NULL -> null in typehints.

  2. +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php
    @@ -555,13 +556,12 @@ public function getBundleExtraFields($entity_type, $bundle) {
    -   * @return
    -   *   The field definition completed for the current runtime context.
    +   * @return \Drupal\field\FieldInterface
    @@ -571,13 +571,12 @@ public function prepareField(FieldInterface $field) {
    -   * @return
    -   *   The field instance array completed for the current runtime context.
    +   * @return \Drupal\field\FieldInstanceInterface

    What's the reason for removing the description text?

I'd say #20 is RTBC, not #19 :)

Assigned:Unassigned» Xano
Status:Reviewed & tested by the community» Needs work

#20 forgets to update a few descriptions that still mention array structures.

Assigned:Xano» Unassigned
Status:Needs work» Needs review
StatusFileSize
new3.33 KB
new5.74 KB
PASSED: [[SimpleTest]]: [MySQL] 59,103 pass(es).
[ View ]

Status:Needs review» Reviewed & tested by the community

back to RTBC

Component:field system» documentation
Status:Reviewed & tested by the community» Fixed
Issue tags:-documentation

Committed and pushed to 8.x. Thanks!

Status:Fixed» Closed (fixed)

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