Problem/Motivation

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/notification_message.install
--------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
28 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
38 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
41 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
42 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: ....1.x/drupal/modules/contrib/notification_message/tests/modules/notification_message_ui_test/notification_message_ui_test.routing.yml
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
6 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/notification_message.module
-------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------
22 | WARNING | [x] A comma should follow the last multiline array item. Found: 'notification-message'
28 | WARNING | [x] A comma should follow the last multiline array item. Found: 'notification-messages'
29 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
108 | ERROR | [ ] Description for the @return value is missing
109 | ERROR | [x] Separate the @return and @throws sections by a blank line.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/README.md
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 15 WARNINGS AFFECTING 15 LINES
-------------------------------------------------------------------------------------------------------
4 | WARNING | Line exceeds 80 characters; contains 394 characters
6 | WARNING | Line exceeds 80 characters; contains 220 characters
29 | WARNING | Line exceeds 80 characters; contains 219 characters
35 | WARNING | Line exceeds 80 characters; contains 152 characters
39 | WARNING | Line exceeds 80 characters; contains 97 characters
41 | WARNING | Line exceeds 80 characters; contains 107 characters
43 | WARNING | Line exceeds 80 characters; contains 166 characters
45 | WARNING | Line exceeds 80 characters; contains 300 characters
47 | WARNING | Line exceeds 80 characters; contains 107 characters
52 | WARNING | Line exceeds 80 characters; contains 156 characters
54 | WARNING | Line exceeds 80 characters; contains 229 characters
56 | WARNING | Line exceeds 80 characters; contains 313 characters
58 | WARNING | Line exceeds 80 characters; contains 120 characters
60 | WARNING | Line exceeds 80 characters; contains 100 characters
62 | WARNING | Line exceeds 80 characters; contains 244 characters
-------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/templates/notification_message.theme
----------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------
13 | ERROR | Missing parameter type
42 | ERROR | Missing parameter type
----------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Form/NotificationMessageTypeForm.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
20 | ERROR | Missing short description in doc comment
--------------------------------------------------------------------------------------------------------------------------------------

FILE: ...sers/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Form/NotificationMessageTypeDeleteForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
14 | ERROR | [ ] Doc comment short description must start with a capital letter
14 | ERROR | [x] Doc comment short description must end with a full stop
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Form/NotificationMessageForm.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------
144 | ERROR | [x] Data types in @var tags need to be fully namespaced
247 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Form/NotificationMessageDeleteForm.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Missing class doc comment
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------

FILE: ...s/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Cache/Context/RouteEntityUuidCacheContext.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------
33 | ERROR | [ ] Parameter $entity_type_manager is not described in comment
92 | ERROR | [x] Expected 1 blank line after function; 0 found
93 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Entity/NotificationMessageStorage.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Missing class doc comment
24 | ERROR | [ ] Missing short description in doc comment
25 | ERROR | [ ] Missing parameter comment
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Entity/NotificationMessageInterface.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
35 | ERROR | Type hint "null" missing for $langcode
48 | ERROR | Missing parameter type
59 | ERROR | Missing parameter type
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Entity/NotificationMessageAccess.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
30 | ERROR | [x] Expected newline after closing brace
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Entity/NotificationMessage.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------
42 | WARNING | Line exceeds 80 characters; contains 85 characters
404 | WARNING | Unused variable $name.
523 | ERROR | Description for the @return value is missing
--------------------------------------------------------------------------------------------------------------------------------

FILE: ...yal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Entity/Routing/NotificationMessageHtmlRouteProvider.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
21 | ERROR | [x] Expected 1 blank line after function; 0 found
22 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

FILE: ...Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/notification_message/src/Plugin/Block/NotificationMessageBlock.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------
43 | ERROR | [ ] Missing short description in doc comment
182 | WARNING | [x] A comma should follow the last multiline array item. Found: )
250 | ERROR | [x] Expected newline after closing brace
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run the following command : phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /drupal/modules/contrib/notification_message

Proposed resolution

the remove the coding standard issues.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 3336005-2.patch18.76 KBsahil.goyal
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sahil.goyal created an issue. See original summary.

sahil.goyal’s picture

StatusFileSize
new18.76 KB

fixing the phpcs warnings and errors, still there are some phpcs errors shows which remain still because those making the code hard to readble.

sahil.goyal’s picture

Status: Active » Needs review

Charchil Khandelwal made their first commit to this issue’s fork.

Charchil Khandelwal’s picture

Assigned: Unassigned » Charchil Khandelwal

I will review this.

Charchil Khandelwal’s picture

Status: Needs review » Needs work

FILE: ...drupal\modules\notification_message\notification_message.install
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
3 | ERROR | Missing short description in doc comment
----------------------------------------------------------------------

FILE: ...cation_message\src\Cache\Context\RouteEntityUuidCacheContext.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
38 | ERROR | Doc comment for parameter $request_stack does not match
| | actual variable name
----------------------------------------------------------------------

FILE: ...\modules\notification_message\src\Entity\NotificationMessage.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
42 | WARNING | Line exceeds 80 characters; contains 85 characters
404 | WARNING | Unused variable $name.
----------------------------------------------------------------------

FILE: ...notification_message\src\Entity\NotificationMessageInterface.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
35 | ERROR | Type hint "null" missing for $langcode
----------------------------------------------------------------------

FILE: ...odules\notification_message\src\Form\NotificationMessageForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
38 | ERROR | Doc comment is empty
----------------------------------------------------------------------

FILE: ...ication_message_ui_test\notification_message_ui_test.routing.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
6 | WARNING | Open page callback found, please add a comment before
| | the line why there is no access restriction
----------------------------------------------------------------------

Need to fix these errors.

Charchil Khandelwal’s picture

Assigned: Charchil Khandelwal » Unassigned

Some warnings and errors are fixed now.
Also created MR !5 for same.
Please review.

Ashutosh Ahirwal made their first commit to this issue’s fork.

ashutosh ahirwal’s picture

Status: Needs work » Needs review
Issue tags: +Coding standards

Created MR15 for fixes of phpcs-issue.

asherry’s picture

Status: Needs review » Fixed

Thank you for this, this is helpful. I made some tweaks that should probably be properly exempted but the rest is committed.

Status: Fixed » Closed (fixed)

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