API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...

Enter a descriptive title (above) relating to class EntityType, then describe the problem you have found:

Nearly all of the documentation blocks in the EntityType annotation class are non-compliant with our documentation standards -- they all need to start with a one-line, one-sentence description. A few of them also have lines that exceed 80 characters in length, and need to be re-wrapped.

Comments

stuti.manandhar’s picture

Assigned: Unassigned » stuti.manandhar
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new3.26 KB

As mentioned in the issue, I have tried to modify EntityType.php to meet coding standards.

tim.plunkett’s picture

  1. +++ b/core/lib/Drupal/Core/Entity/Annotation/EntityType.php
    @@ -35,11 +35,14 @@ class EntityType extends Plugin {
    +   * Array of controllers associated with the entity type
    
    @@ -179,6 +181,8 @@ class EntityType extends Plugin {
    +   * Entity keys related to entity type
    
    @@ -265,6 +270,8 @@ class EntityType extends Plugin {
    +   * Permission for the entity type
    

    Missing trailing .

  2. +++ b/core/lib/Drupal/Core/Entity/Annotation/EntityType.php
    @@ -257,7 +261,8 @@ class EntityType extends Plugin {
    +   * @link http://www.iana.org/assignments/link-relations/link-relations.xml ¶
    +   * @endlink
    

    I think @link/@endlink are okay to exceed 80 chars, they need to be on one line

  3. +++ b/core/lib/Drupal/Core/Entity/Annotation/EntityType.php
    @@ -274,4 +281,4 @@ class EntityType extends Plugin {
    -}
    +}
    \ No newline at end of file
    

    Omit this change

jhodgdon’s picture

Status: Needs review » Needs work

Status as per previous review

stuti.manandhar’s picture

Status: Needs work » Needs review
StatusFileSize
new2.88 KB

Changes made as suggested in comments.

lokapujya’s picture

Status: Needs review » Needs work

Line 283 adds a blank space. The word after @todo should be capitalized.

richard.c.allen2386’s picture

I went back and looked at the code here and it doesn't look like any of this code is left in the current 8.x branch? We were going to help clean this up for a ladder sprint but it seems to not be applicable anymore. Some confirm and maybe close? The issue is mentioned on drupalmentoring.org

tim.plunkett’s picture

The code in question has moved to core/lib/Drupal/Core/Entity/EntityTypeInterface.php

I'm not sure that there are still fixes needed, but someone should check.

jhodgdon’s picture

The original report was actually for the EntityType annotation class: core/lib/Drupal/Core/Entity/Annotation/EntityType.php

There's not much there now and I have no idea where the rest of the annotation stuff for entity types has been moved to, but it's not in core/lib/Drupal/Core/Entity/EntityTypeInterface.php either. ???

tim.plunkett’s picture

Instead of documenting each annotation key, we now document each method used to retrieve it.
The docblocks were moved and reworded only slightly. s/An associative array that/Returns an associative array that/, etc.

jhodgdon’s picture

Status: Needs work » Closed (cannot reproduce)

Well. That makes the Annotations topic we have on api.drupal.org nearly useless -- I set it up a while back so that each @Annotation class got shown there, but they have nearly zero documentation and no links to their interfaces:
https://api.drupal.org/api/drupal/core!modules!system!system.api.php/gro...

Which is a separate issue -- this one can be closed. I filed:
#2189497: Object-based Annotation classes need links to interfaces