Problem/Motivation
FILE: ...contribution/web/modules/contrib/entitytype_filter/src/Form/FilterEntityTypesForm.php
-------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 7 WARNINGS AFFECTING 11 LINES
-------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one
| | is Drupal\Core\Entity\EntityTypeManagerInterface.
79 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection
| | instead
113 | WARNING | [ ] Only string literals should be passed to t() where possible
119 | WARNING | [ ] Only string literals should be passed to t() where possible
162 | WARNING | [ ] #options values usually have to run through t() for translation
163 | WARNING | [ ] #options values usually have to run through t() for translation
164 | WARNING | [ ] #options values usually have to run through t() for translation
196 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use
| | placeholders with t() for variables
196 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders
| | instead and only one string literal
268 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders
| | instead and only one string literal
271 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders
| | instead and only one string literal
274 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders
| | instead and only one string literal
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------
FILE: .../contribution/web/modules/contrib/entitytype_filter/src/Form/FilterFieldTypesForm.php
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one
| | is Drupal\Core\Entity\EntityTypeManagerInterface.
130 | WARNING | [ ] Unused variable $key.
195 | WARNING | [ ] Unused variable $category.
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------
FILE: ...b/modules/contrib/entitytype_filter/src/Controller/EntitiesAutoCompleteController.php
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\Core\Entity\EntityTypeManagerInterface.
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------
FILE: .../web/modules/contrib/entitytype_filter/src/Controller/FilterEntityTypesController.php
-------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
21 | WARNING | \Drupal calls should be avoided in classes, use dependency injection
| | instead
-------------------------------------------------------------------------------------------
FILE: ...n/web/modules/contrib/entitytype_filter/src/Controller/FilterFieldTypesController.php
-------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
16 | WARNING | \Drupal calls should be avoided in classes, use dependency injection
| | instead
-------------------------------------------------------------------------------------------
Steps to reproduce
Run following command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml entitytype_filter/
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
harsh commentedI have fixed the phpcs issues.Please review the patch
Comment #3
avpadernoThe form builder. is sufficient.
The documentation comment for constructors is not mandatory anymore, If it is given, the description must be Constructs a new [class name] object. where [class name] includes the class namespace.
Code shown in documentation comments is not quoted with
`.The documentation comment for a method inherited from a parent class or defined in an interface is different.
Since that documentation comment is changed, also the class description must be changed, as the description must not repeat the class name.
Comment #4
harsh commentedI have updated the patch as per comment #3.Please review
Comment #5
avpadernoThat is not the documentation comment for constructors. Also, the documentation comment for constructors is not mandatory anymore.
The return value description must not start with Returns.
Since that comment is changed, also the method description must be changed, as it must not start with The function returns.
in Drupal is not necessary.
Comment #9
rakesh.regarMR raised updating status to needs review.
Comment #10
avpadernoComment #11
rakesh.regarComment #12
avpadernoComment #13
rakesh.regarComment #14
avpadernoA summary must describe what needs to be changed, and eventually why. A screenshot is not sufficient, even in the case a patch/MR is provided.
In the case of bug reports, the steps to reproduce the bug should be provided too. In the case of coding standards issues found using an automatic tool, the report given by that tool must be quoted too, including the arguments passed to that tool, if it is a command line tool.
Also, since the MR is changing more files than the ones reported in the issue summary, I take the issue summary must be updated.
Comment #15
rakesh.regarHey @apaderno
I have made some changes in PR and had some confution about the comment, please check it.
Thanks.
Comment #16
avpadernoThe issue summary update does not say which command has been used to obtain the quoted report nor which CLI arguments have been passed to the command.
Comment #17
zkhan.aamir commentedIssue summary updated
Comment #18
Shreyas gowda commentedComment #20
manish-31 commentedI have updated the MR with the changes required as per the MR feedback. Needs review.
I confirmed that there are no errors when running PHP CodeSniffer now, so I'm updating the issue status to 'Needs Review'.
Comment #21
deepak5423 commentedAfter applying !MR5 no phpcs error was found.
Looks good to me.
Comment #22
hetal.solankiComment #24
keshav patel commentedThanks everyone, I've merged the changes.
Comment #25
keshav patel commented