FILE: ...modules/git/menu_condition/src/Plugin/Condition/MenuPosition.php
----------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------
   3 | ERROR | [x] Namespaced classes, interfaces and traits should
     |       |     not begin with a file doc comment
  19 | ERROR | [ ] Missing short description in doc comment
  58 | ERROR | [x] Parameter comment must end with a full stop
  60 | ERROR | [x] Parameter comment must end with a full stop
  62 | ERROR | [x] Parameter comment must end with a full stop
 116 | ERROR | [x] Short array syntax must be used to define arrays
 135 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------

Comments

deepanker_bhalla created an issue. See original summary.

deepanker_bhalla’s picture

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

Fixed the coding standard.

joachim’s picture

Status: Needs review » Needs work

Thanks for the patch!

Looks good apart from this:

+++ b/src/Plugin/Condition/MenuPosition.php
@@ -17,6 +12,8 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 /**
+ * {@inheritdoc}
+ *

AFAIK inheritdoc is not used for classes, and I definitely know that it can't be combined with anything else in the docblock.

First line here should instead briefly describe the plugin.

deepanker_bhalla’s picture

Status: Needs work » Needs review

@joachim:

I think the module creator must describe the plugin perfectly. So we can left it to him.

msankhala’s picture

Status: Needs review » Needs work

@deepanker_bhalla, @joachim is this module's creator. You can add docblock something like:

Provides a 'Menu position' condition.

As per suggested in https://www.drupal.org/docs/develop/standards/api-documentation-and-comment-standards#classes

dhirendra.mishra’s picture

Assigned: Unassigned » dhirendra.mishra

working on it.

dhirendra.mishra’s picture

Assigned: dhirendra.mishra » Unassigned
Status: Needs work » Needs review
StatusFileSize
new344 bytes
new2.67 KB

uploading patch.

msankhala’s picture

Status: Needs review » Needs work
diff --git a/src/Plugin/Condition/MenuPosition.php b/src/Plugin/Condition/MenuPosition.php
...
+ * Provides a 'Menu position' condition.
+ * {@inheritdoc}
+ *

Remove this {@inheritdoc}.

dhirendra.mishra’s picture

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

Correction from #8. Please review it.

msankhala’s picture

Status: Needs review » Reviewed & tested by the community

@dhirendra.mishra @deepanker_bhalla Good work. I can confirm the patch #9 is applying cleanly and fixing all the coding standard reported by the PHPCS. Here is the output:

❯ menu_condition 8.x-1.x* git apply -v 3001434-coding-standard-9.patch
Checking patch src/Plugin/Condition/MenuPosition.php...
Applied patch src/Plugin/Condition/MenuPosition.php cleanly.

❯ menu_condition 8.x-1.x* phpcs --standard=Drupal .

❯ menu_condition 8.x-1.x*

PHPCS is reporting no coding standard warning after applying the patch #9 and its fixing concern reported in #3.

joachim’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone! I appreciate the attention to detail.

Status: Fixed » Closed (fixed)

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