This is a part of the attempt to fix #2572645: [Meta] Fix 'Drupal.Commenting.FunctionComment' coding standard

This issue is created to tackle the sub-sniffs

Drupal.Commenting.FunctionComment.IncorrectTypeHint
Drupal.Commenting.FunctionComment.InvalidTypeHint

CommentFileSizeAuthor
#75 interdiff_71_75.txt601 bytesanmolgoyal74
#75 2723621-75.patch25.46 KBanmolgoyal74
#71 2723621-71.patch25.51 KBlongwave
#70 interdiff-2723621-69-70.txt9.44 KBabhisekmazumdar
#70 2723621-70.patch24.38 KBabhisekmazumdar
#69 2723621-69.patch14.95 KBabhisekmazumdar
#67 interdiff_66-67.txt8.06 KBSuresh Prabhu Parkala
#67 2723621-67.patch24.26 KBSuresh Prabhu Parkala
#66 reroll_diff_2723621_62-66.txt16 KBankithashetty
#66 2723621-66.patch24.31 KBankithashetty
#62 2723621-62.patch24.38 KBalexpott
#62 60-62-interdiff.txt1013 bytesalexpott
#60 2723621-60.patch24.38 KBalexpott
#53 2723621-53.patch25.58 KBjofitz
#53 interdiff-2723621-49-53.txt1.8 KBjofitz
#49 2723621-49.patch24 KBjofitz
#49 interdiff-2723621-46-49.txt878 bytesjofitz
#46 2723621-46.patch24.11 KBjofitz
#46 interdiff-2723621-44-46.txt2.14 KBjofitz
#44 2723621-44.patch22.22 KBjofitz
#39 drupal-coding-standards-2723621-39.patch22.85 KBsnehi
#39 interdiff.txt689 bytessnehi
#35 drupal-coding-standards-2723621-35.patch22.83 KBneclimdul
#35 drupal-coding-standards-2723621-35.mergediff.txt1.17 KBneclimdul
#32 interdiff-2723621-26-32.txt2.93 KBmfernea
#32 drupal-coding-standards-2723621-32.patch22.99 KBmfernea
#26 drupal-coding-standards-2723621-26.patch25.01 KBmfernea
#23 drupal-coding-standards-2723621-23.patch22.92 KBmfernea
#21 interdiff-2723621-17-21.txt4.5 KBmfernea
#21 drupal-coding-standards-2723621-21.patch22.91 KBmfernea
#17 fix-2723621-16.patch19.74 KBhgunicamp
#14 fix-2723621-14.patch19.49 KBempesan
#10 fix-2723621-10.patch20.46 KBkostyashupenko
#2 drupal-coding-standards-function-comment-IncorrectTypeHint-2723621-2.patch20.53 KBanoopjohn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anoopjohn created an issue. See original summary.

anoopjohn’s picture

Please find attached a patch for the same.

Mile23’s picture

Status: Needs review » Needs work
Issue tags: +Documentation
+++ b/core/lib/Drupal/Core/Entity/entity.api.php
@@ -892,7 +892,7 @@ function hook_ENTITY_TYPE_storage_load(array $entities) {
+function hook_entity_presave(\Drupal\Core\Entity\EntityInterface $entity) {

I'm pretty sure all of these hook type hints should be in use statements at the top of the file. It might be a different standard for .api.php files, but I doubt it.

The rest looks pretty OK but I didn't try too hard after finding the above.

anoopjohn’s picture

There is another sniff for catching the use statement instead of the fully qualified class name. We can address the use issue there right? Most of the fixes in the patch only involved the addition of the first namespace separator in front of the fully qualified class name.

Can you please clarify as to what should be documented?

anoopjohn’s picture

Status: Needs work » Needs review
dawehner’s picture

Status: Needs review » Needs work

I'm pretty sure all of these hook type hints should be in use statements at the top of the file. It might be a different standard for .api.php files, but I doubt it.

There is actually a standard on .api.php pages, indeed. I cannot find an official bit in https://www.drupal.org/node/1354#hooks but could read

If you use a namespace on a class anywhere in documentation, always make sure it is a fully-qualified namespace (beginning with a backslash).

like that.

+++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
@@ -59,7 +59,7 @@ public function query($get_count = FALSE) { }
-   * @param view $view
+   * @param ViewExecutable $view

@@ -67,7 +67,7 @@ public function alter(ViewExecutable $view) {  }
-   * @param view $view
+   * @param ViewExecutable $view

@@ -82,7 +82,7 @@ public function build(ViewExecutable $view) { }
-   * @param view $view
+   * @param ViewExecutable $view

@@ -93,7 +93,7 @@ public function execute(ViewExecutable $view) {  }
-   * @param view $view
+   * @param ViewExecutable $view

Let's make that FQCN, so with the namespace

Mile23’s picture

If you use a namespace on a class anywhere in documentation, always make sure it is a fully-qualified namespace (beginning with a backslash).

I guess it's much easier to read in the context of an API code example than looking for the use statement.

dawehner’s picture

I guess it's much easier to read in the context of an API code example than looking for the use statement.

Yes, that is a good point.

Mile23’s picture

Issue tags: +Needs reroll

Patch in #2 no longer applies.

kostyashupenko’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
20.46 KB

automerged

Status: Needs review » Needs work

The last submitted patch, 10: fix-2723621-10.patch, failed testing.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

empesan’s picture

Patch rerolled against 8.4.x

empesan’s picture

Status: Needs work » Needs review
hgunicamp’s picture

Status: Needs review » Needs work
Issue tags: +ciandt-contrib

I applied the 'fix-2723621-14.patch' patch and it failed in 'core/phpcs.xml.dist' file.

cit008490cpsubuntu:drupal progestag* 8.4.x$ cat core/phpcs.xml.dist.rej

--- core/phpcs.xml.dist
+++ core/phpcs.xml.dist
@@ -44,10 +44,8 @@
   <rule ref="Drupal.Commenting.DocCommentStar"/>
   <rule ref="Drupal.Commenting.FileComment"/>
   <rule ref="Drupal.Commenting.FunctionComment">
-    <exclude name="Drupal.Commenting.FunctionComment.IncorrectTypeHint"/>
     <exclude name="Drupal.Commenting.FunctionComment.InvalidNoReturn"/>
     <exclude name="Drupal.Commenting.FunctionComment.InvalidReturnNotVoid"/>
-    <exclude name="Drupal.Commenting.FunctionComment.InvalidTypeHint"/>
     <exclude name="Drupal.Commenting.FunctionComment.Missing"/>
     <exclude name="Drupal.Commenting.FunctionComment.MissingFile"/>
     <exclude name="Drupal.Commenting.FunctionComment.MissingParamComment"/>
hgunicamp’s picture

Status: Needs work » Needs review
FileSize
19.74 KB

I fixed the problem I found in the 'fix-2723621-14.patch' patch and posted a new one. ( 'fix-2723621-16.patch')

dawehner’s picture

+++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
@@ -59,7 +59,7 @@ public function query($get_count = FALSE) { }
-   * @param view $view
+   * @param ViewExecutable $view

@@ -67,7 +67,7 @@ public function alter(ViewExecutable $view) {  }
-   * @param view $view
+   * @param ViewExecutable $view

@@ -82,7 +82,7 @@ public function build(ViewExecutable $view) { }
-   * @param view $view
+   * @param ViewExecutable $view

@@ -93,7 +93,7 @@ public function execute(ViewExecutable $view) {  }
-   * @param view $view
+   * @param ViewExecutable $view

Is there a reason we don't use a fully qualified class name (FQCN)?

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mfernea’s picture

Issue tags: +Coding standards

I added the "coding standards" tag.

mfernea’s picture

Here is the new patch. There were some new errors and I also fixed the issues mentioned at #18.

Status: Needs review » Needs work

The last submitted patch, 21: drupal-coding-standards-2723621-21.patch, failed testing. View results

mfernea’s picture

Status: Needs work » Needs review
FileSize
22.92 KB

Re-roll.

Status: Needs review » Needs work

The last submitted patch, 23: drupal-coding-standards-2723621-23.patch, failed testing. View results

mfernea’s picture

Assigned: Unassigned » mfernea
mfernea’s picture

Assigned: mfernea » Unassigned
Status: Needs work » Needs review
FileSize
25.01 KB

Re-roll.

martin107’s picture

Status: Needs review » Reviewed & tested by the community

All these changes look justifiable to me.

Looking at the lats testbot report ... I can see no last minute errors have crept in.

In short, I think this patch looks great .. and we should get this in..

Mile23’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/includes/install.inc
@@ -457,7 +457,7 @@ function _drupal_rewrite_settings_dump($variable, $variable_name) {
- * @param object $variable
+ * @param \stdClass $variable

'object' is correct.

https://www.drupal.org/docs/develop/coding-standards/api-documentation-a...

Does coder disagree?

mfernea’s picture

Status: Needs work » Needs review

_drupal_rewrite_settings_dump_one() is defined as:
function _drupal_rewrite_settings_dump_one(\stdClass $variable, $prefix = '', $suffix = '')
and so PHPCS complains about:
@param object $variable

@param \stdClass is used in other places too.

Mile23’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The coding standard says use object and not stdClass: https://www.drupal.org/docs/develop/coding-standards/api-documentation-a...

Also needs a re-roll.

If Coder adds stdClass then it's wrong. If there's not a sniff for object vs. stdClass then there should be. In either (or both) of those cases we should file an issue against Coder.

mfernea’s picture

Assigned: Unassigned » mfernea
mfernea’s picture

Assigned: mfernea » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
22.99 KB
2.93 KB

Here is the updated patch and the interdiff.
The interdiff contains removal of phpcs.local.xml which was present at #26 and shouldn't have been part of the patch.

mfernea’s picture

@Mile23 I guess we should also open a follow-up for other places where \stdClass is used as a typehint. Should we fix them here? Gray area between in and out of scope :). What do you think?

I opened #2911404: Drupal.Commenting.FunctionComment.InvalidTypeHint/FunctionComment - \stdClass for the stdClass vs \stdClass issue.

joshmiller’s picture

Checked to see if patch applies, and it does, pretty cleanly (no errors). Not enough time to test to see if the phpcs is now passing.

Hopefully this comment encourages another to run the tests.

neclimdul’s picture

suraj2012’s picture

Checked the patch "drupal-coding-standards-2723621-35.patch" .
It applies cleanly. I also ran the phpcs test after that and there were no errors.

Mile23’s picture

+++ b/core/includes/install.inc
@@ -467,7 +467,7 @@ function _drupal_rewrite_settings_dump($variable, $variable_name) {
-function _drupal_rewrite_settings_dump_one(\stdClass $variable, $prefix = '', $suffix = '') {
+function _drupal_rewrite_settings_dump_one($variable, $prefix = '', $suffix = '') {

The patch is still mostly fine, but it does the above. We shouldn't remove a valid type hint.

Reverting that file and then sniffing it yields this:

FILE: /Users/paul/pj2/drupal/core/includes/install.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 470 | ERROR | Unknown type hint "\stdClass" found for $variable
     |       | (Drupal.Commenting.FunctionComment.InvalidTypeHint)
----------------------------------------------------------------------

Time: 1.22 secs; Memory: 12Mb

Changing the hint to stdClass (no \) gets a pass from phpcs. I suppose that's because it's in an .inc file which is in the top-level namespace. InvalidTypeHint doesn't seem to care about that namespace \ in other usages, such as within a namespaced class. So InvalidTypeHint doesn't seem to be at 100% #2911404: Drupal.Commenting.FunctionComment.InvalidTypeHint/FunctionComment - \stdClass

If we add back stdClass (instead of \stdClass), then this patch will be ready to go. If the sniff ever gets fixed, and it turns out stdClass is not right, then it will show up and we can fix it then.

Mile23’s picture

Status: Needs review » Needs work
snehi’s picture

Status: Needs work » Needs review
FileSize
689 bytes
22.85 KB

Given it a try.

Mile23’s picture

Status: Needs review » Reviewed & tested by the community

This addresses the issues from #37 and PHPCS is happy. :-)

neclimdul’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -730,7 +730,7 @@ public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkConten
-   * @param \Drupal\menu_link_content\MenuLinkContentInterface $item
+   * @param \Drupal\menu_link_content\MenuLinkContent $item

Why wouldn't we use the interface? Does the method signature need to be fixed instead?

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

idebr’s picture

Issue tags: +Needs reroll

#41 I agree with ideally this would type hint the MenuLinkContentInterface. However, if you look at the MenuUiTest.php file, all other methods typehint the MenuLinkContent. Considering this issue is about bring the type hint in line with the actual code, I suggest we go with the smallest change possible and update the documentation to match the code here and leave the change in the actual code to a follow up.

The MenuUiTest was moved in #2723621: Fix Drupal.Commenting.FunctionComment.IncorrectTypeHint and Drupal.Commenting.FunctionComment.InvalidTypeHint, so the patch no longer applies.

jofitz’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
22.22 KB

Re-rolled.

Mile23’s picture

Patch still applies, but I see this:

$ ../vendor/bin/phpcs -ps .

FILE: ...cts/drupal8/core/tests/Drupal/KernelTests/AssertContentTrait.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 987 | ERROR | Expected type hint "SimpleXmlElement"; found
     |       | "\SimpleXMLElement" for $element
     |       | (Drupal.Commenting.FunctionComment.IncorrectTypeHint)
----------------------------------------------------------------------


FILE: ...drupal8/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 729 | ERROR | Expected type hint "MenuLinkContentInterface"; found
     |       | "MenuLinkContent" for $item
     |       | (Drupal.Commenting.FunctionComment.IncorrectTypeHint)
----------------------------------------------------------------------


FILE: ...edia/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 131 | ERROR | Unknown type hint "array" found for
     |       | $formatter_settings
     |       | (Drupal.Commenting.FunctionComment.InvalidTypeHint)
----------------------------------------------------------------------

Time: 5 mins, 52.9 secs; Memory: 86Mb
jofitz’s picture

Corrected the 3 errors.

Status: Needs review » Needs work

The last submitted patch, 46: 2723621-46.patch, failed testing. View results

idebr’s picture

+++ b/core/tests/Drupal/KernelTests/AssertContentTrait.php
@@ -984,7 +984,7 @@ protected function assertFieldByXPath($xpath, $value = NULL, $message = '', $gro
-  protected function getSelectedItem(\SimpleXMLElement $element) {
+  protected function getSelectedItem(SimpleXMLElement $element) {

This line is changed the wrong way around. The @param should mention \SimpleXMLElement (mind the capitals). The current method argument in HEAD is correct.

jofitz’s picture

Status: Needs work » Needs review
FileSize
878 bytes
24 KB

Corrected my incorrect correction!

Thanks @idebr.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

idebr’s picture

Status: Needs review » Needs work

DrupalCI reports 4 additional incorrect typehints at the latest build: https://www.drupal.org/pift-ci-job/1017856

These were added recently in #2975754: Add hooks to act on a new revision being created

/var/lib/drupalci/workspace/jenkins-drupal_patches-65188/source/core/lib/Drupal/Core/Entity/entity.api.php
line 930 Expected type hint "EntityInterface"; found "Drupal\Core\Entity\EntityInterface" for $new_revision
930 Expected type hint "EntityInterface"; found "Drupal\Core\Entity\EntityInterface" for $entity
954 Expected type hint "EntityInterface"; found "Drupal\Core\Entity\EntityInterface" for $new_revision
954 Expected type hint "EntityInterface"; found "Drupal\Core\Entity\EntityInterface" for $entity

Mile23’s picture

This calls back to #6.

So I think we need clarity on whether .api pages should have fully-qualified class names in hints or not, and make sure there's a coder rule for it.

jofitz’s picture

Status: Needs work » Needs review
FileSize
1.8 KB
25.58 KB

Corrected the 4 coding standards errors.

Mile23’s picture

Status: Needs review » Reviewed & tested by the community

Ahh the slashes. :-)

LGTM, and the CI, so yay.

alexpott’s picture

+++ b/core/includes/install.inc
@@ -465,7 +465,7 @@ function _drupal_rewrite_settings_dump($variable, $variable_name) {
-function _drupal_rewrite_settings_dump_one(\stdClass $variable, $prefix = '', $suffix = '') {
+function _drupal_rewrite_settings_dump_one(stdClass $variable, $prefix = '', $suffix = '') {

This change is really odd. Imo we shouldn't be making it. The whole coding standard of object vs stdClass for any old object makes sense in every cases apart from this one where the thing is a \stdClass. That said maybe the gains of the patch outweigh this one awkwardness and we can address it more properly in the follow-up. Imo coder should be fixed as per @Mile23's comment on #2911404: Drupal.Commenting.FunctionComment.InvalidTypeHint/FunctionComment - \stdClass. Maybe we should postpone on that - dunno.

Mile23’s picture

Status: Reviewed & tested by the community » Postponed

Okie.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

alexpott’s picture

Status: Postponed » Needs work
alexpott’s picture

Version: 8.9.x-dev » 9.0.x-dev
Status: Needs work » Needs review
FileSize
24.38 KB

Here we go... the blocker went in ages ago.

Status: Needs review » Needs work

The last submitted patch, 60: 2723621-60.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

alexpott’s picture

Status: Needs work » Needs review
FileSize
1013 bytes
24.38 KB

Too many DateFormatInterface classes :)

xjm’s picture

Version: 9.0.x-dev » 8.8.x-dev

Turning on new coding standards a minor-only change (although we can backport the cleanups without the rule in some cases to preserve cherry-picks). Since this is just docs, it's backportable; however, the backport patch would need to have a version that does not include the phpcs.xml.dist change.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

longwave’s picture

Version: 8.9.x-dev » 9.2.x-dev
Status: Needs review » Needs work
Issue tags: +Needs reroll

Needs a reroll.

ankithashetty’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
24.31 KB
16 KB

Re-rolled the patch in #62. Thanks!

Suresh Prabhu Parkala’s picture

Updated patch. Please review!

daffie’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Entity/entity.api.php
@@ -8,6 +8,7 @@
+use Drupal\Core\Entity\EntityInterface;

Can we not add this line and keep the long format. This is an example file for other developers.

abhisekmazumdar’s picture

Status: Needs work » Needs review
FileSize
14.95 KB

For some reason the last two patches are getting applied. So I have excluded the changes done on core/lib/Drupal/Core/Entity/entity.api.php as per the suggestion on #68.

Kindly review the patch.

abhisekmazumdar’s picture

Oops !!
Updated the patch.

longwave’s picture

FileSize
25.51 KB

Fixed the reroll, addressed three other issues found by running phpcs.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

All code changes look good to me.
I have run PHPCS on my local machine and with the patch applied there are no errors.
For me is it RTBC.

I was wondering if we should create a followup to fix:

diff --git a/core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php b/core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php
index 42ba1661c3..9c7daaf1ba 100644
--- a/core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php
+++ b/core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\system\Plugin\migrate\destination;
 
+use Drupal\Core\Datetime\DateFormatInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\migrate\Plugin\migrate\destination\EntityConfigBase;
 
@@ -15,10 +16,11 @@ class EntityDateFormat extends EntityConfigBase {
   /**
    * {@inheritdoc}
    *
-   * @param \Drupal\Core\Datetime\DateFormatInterface $entity
+   * @param \Drupal\Core\Entity\EntityInterface $entity
    *   The date entity.
    */
   protected function updateEntityProperty(EntityInterface $entity, array $parents, $value) {
+    assert($entity instanceof DateFormatInterface);
     if ($parents[0] == 'pattern') {
       $entity->setPattern($value);
     }
catch’s picture

Would be good to have a follow-up for #72. I also I think we should leave the assert() out of the 9.1.x backport (along with the hunk that enables the drupalcs checks).

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php
@@ -15,10 +16,11 @@ class EntityDateFormat extends EntityConfigBase {
   /**
    * {@inheritdoc}
    *
-   * @param \Drupal\Core\Datetime\DateFormatInterface $entity
+   * @param \Drupal\Core\Entity\EntityInterface $entity
    *   The date entity.
    */

This should remove the @param doc entirely. Having {inheritdoc} and a single @param override breaks api.drupal.org - see https://api.drupal.org/api/drupal/core%21modules%21system%21src%21Plugin...

This method has three params but only one is documented.

If we want to change one param we have to provide a full docblock.

anmolgoyal74’s picture

Status: Needs work » Needs review
FileSize
25.46 KB
601 bytes

Removed the @param doc.
We can handle #72 in a follow-up.

longwave’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 203ad06 and pushed to 9.2.x. Thanks!

The patch doesn't apply to 9.1.x so fixing only in 9.2.x.

  • alexpott committed 203ad06 on 9.2.x
    Issue #2723621 by jofitz, mfernea, alexpott, abhisekmazumdar, neclimdul...

Status: Fixed » Closed (fixed)

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