FILE: .../contrib/view_modes_display/src/Controller/DefaultController.php
----------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 12 LINES
----------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should
    |       |     not begin with a file doc comment
 23 | ERROR | [ ] Missing short description in doc comment
 24 | ERROR | [ ] Missing parameter comment
 25 | ERROR | [ ] Description for the @return value is missing
 31 | ERROR | [ ] Missing short description in doc comment
 32 | ERROR | [ ] Missing parameter comment
 32 | ERROR | [ ] Doc comment for parameter $block does not match
    |       |     actual variable name $block_content
 33 | ERROR | [ ] Description for the @return value is missing
 39 | ERROR | [ ] Missing short description in doc comment
 40 | ERROR | [ ] Missing parameter comment
 41 | ERROR | [ ] Description for the @return value is missing
 50 | ERROR | [ ] Description for the @return value is missing
 78 | ERROR | [x] Inline comments must end in full-stops, exclamation
    |       |     marks, colons, question marks, or closing
    |       |     parentheses

Comments

Aston Victor created an issue. See original summary.

jigish.addweb’s picture

StatusFileSize
new4.67 KB

@Aston Victor, Please find my patch for Coding standard errors, Also I've added the required comments with other code in DefaultController.php. Hope this helps you!..

Thanks

jigish.addweb’s picture

Status: Active » Needs review
deepanker_bhalla’s picture

Status: Needs review » Needs work

@jigish.addweb: Good work. I can confirm the patch #2 is applying cleanly. Here is the output:

❯ view_modes_display 8.x-1.x* git apply -v view_modes_display-2997388-2.patch

view_modes_display-2997388-2.patch:11: trailing whitespace.
When working on a site with many content types and view modes
view_modes_display-2997388-2.patch:12: trailing whitespace.
for example,
view_modes_display-2997388-2.patch:13: trailing whitespace.
it becomes tedious to find out where to view the rendered entity
view_modes_display-2997388-2.patch:14: trailing whitespace.
in a given view mode.
view_modes_display-2997388-2.patch:15: trailing whitespace.
This helper module aims to solve this by providing an
Checking patch README.txt...
Checking patch src/Controller/DefaultController.php...
Applied patch README.txt cleanly.
Applied patch src/Controller/DefaultController.php cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

_________________________________________________________________________________________________________

But after checking with phpcs --standard=Drupal view_modes_display/....... I am getting some more issues i.e.

FILE: /var/www/html/tolearn/modules/git/view_modes_display/src/Controller/DefaultController.php
-----------------------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------
 22 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
 22 | ERROR | [x] Parameter comment must end with a full stop
 23 | ERROR | [x] Separate the @param and @return sections by a blank line.
 34 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
 34 | ERROR | [x] Parameter comment must end with a full stop
 35 | ERROR | [x] Separate the @param and @return sections by a blank line.
 46 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
 46 | ERROR | [x] Parameter comment must end with a full stop
 47 | ERROR | [x] Separate the @param and @return sections by a blank line.
 58 | ERROR | [x] Return comment indentation must be 3 spaces, found 1 spaces
-----------------------------------------------------------------------------------------------
deepanker_bhalla’s picture

Status: Needs work » Needs review
StatusFileSize
new4.7 KB

Thus updating the patch with the consolidated fixes of the old and new ones.

zach.bimson’s picture

Thanks guys, committed!

zach.bimson’s picture

Status: Needs review » Fixed
zach.bimson’s picture

Status: Fixed » Closed (fixed)