Problem/Motivation
FILE: ...dules/contrib/user_agent_class/src/EventSubscriber/UserAgentSubscriber.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
14 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------
FILE: ...n/drupal10/web/modules/contrib/user_agent_class/src/CheckAgentServices.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------
FILE: ...dules/contrib/user_agent_class/src/Controller/CheckUserAgentController.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------
FILE: ...0/web/modules/contrib/user_agent_class/src/CheckAgentServicesInterface.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------
FILE: ...al10/web/modules/contrib/user_agent_class/src/Form/UserAgentEntityForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------
FILE: ...rupal10/web/modules/contrib/user_agent_class/src/Form/DeviceEntityForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------
FILE: ...ion/drupal10/web/modules/contrib/user_agent_class/src/Form/ProvideForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------
Time: 731ms; Memory: 10MB
Steps to reproduce
Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig user_agent_class/
Proposed resolution
Fix the issues for Drupal and DrupalPractice coding standards
Remaining tasks
Patch review.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | user_agent_class-code-styles-issue-3361493-15072534.patch | 3.65 KB | artsays |
| #7 | interdiff-4_7.txt | 1.88 KB | urvashi_vora |
| #7 | coding_standard_fixes_7.patch | 3.05 KB | urvashi_vora |
| #4 | interdiff-0_4.txt | 1.15 KB | urvashi_vora |
| #4 | coding_standard_fixes_4.patch | 2.92 KB | urvashi_vora |
Comments
Comment #2
avpadernoClass descriptions must not start with Implements and then repeat the class name and the interface name. That information is already given from the code. What descriptions should do is describing the class purpose or what the class does.
That is still repeating the interface name, even if spaces have been added.
That description is still repeating the class name.
Comment #3
urvashi_vora commentedThanks for the feedback will provide a patch asap.
Comment #4
urvashi_vora commentedProviding the updated patch with suggestions of #2. Please review.
Thanks
Comment #5
avpadernoOnly the first word in the description must be capitalized.
The description must say what the class purpose is, not which interfaces are implemented by the class or the class name.
If those are entity form classes, for should be followed by the entity for which those forms are built.
That is still repeating the class name, except a space has been put in the middle of the class name. That description does not say what the class does. (Hint: It extends
ConfigFormBase.)Comment #6
urvashi_vora commentedI will provide a patch asap. Assigning it to myself.
Thanks
Comment #7
urvashi_vora commentedPlease review the updated patch. Thanks
Comment #8
artsays commentedThank you for your contribution and for fixing class descriptions.
The issue also appeared with ordering in Uses namespaces.
Attached patch and combining with fixes for both issues.
It would be part of new release tag 8.x-6.2
Comment #9
artsays commentedComment #10
artsays commentedComment #11
artsays commented