Fix the issues reported by phpcs

Created on 5 July 2023, over 1 year ago
Updated 29 September 2023, about 1 year ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/nostr_id_nip05/nostr_id_nip05.module
------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------
10 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
11 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
12 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/nostr_id_nip05/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
38 | WARNING | Line exceeds 80 characters; contains 136 characters
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/nostr_id_nip05/nostr_id_nip05.install
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
28 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/nostr_id_nip05/src/Form/AddNostrKeyForm.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 9 WARNINGS AFFECTING 14 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
17 | ERROR | [ ] Missing short description in doc comment
18 | ERROR | [x] Data types in @var tags need to be fully namespaced
22 | ERROR | [ ] Missing short description in doc comment
23 | ERROR | [ ] Missing parameter comment
23 | ERROR | [x] Data types in @param tags need to be fully namespaced
58 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
58 | ERROR | [x] Expected one space after the comma, 2 found
59 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
84 | WARNING | [x] A comma should follow the last multiline array item. Found: '@'
86 | WARNING | [x] 'TODO add fields for submitting your relays you prefer to post notes.' should match the format '@todo Fix problem X
| | here.'
96 | WARNING | [x] 'TODO validate bech32 encoded key' should match the format '@todo Fix problem X here.'
96 | WARNING | [x] There must be no blank line following an inline comment
96 | WARNING | [ ] There must be no blank line following an inline comment
96 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
98 | ERROR | [x] Expected newline after closing brace
99 | WARNING | [x] 'TODO validate hex encoded key' should match the format '@todo Fix problem X here.'
99 | WARNING | [x] There must be no blank line following an inline comment
99 | WARNING | [ ] There must be no blank line following an inline comment
99 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
113 | ERROR | [x] Expected newline after closing brace
113 | ERROR | [x] Inline control structures are not allowed
127 | ERROR | [x] Expected 1 blank line after function; 0 found
128 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/nostr_id_nip05/src/Controller/NostrIdNip05Controller.php
--------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 9 LINES
--------------------------------------------------------------------------------------
12 | ERROR | [x] Missing class doc comment
14 | ERROR | [ ] Missing short description in doc comment
15 | ERROR | [x] Data types in @var tags need to be fully namespaced
26 | ERROR | [ ] Parameter $database is not described in comment
29 | ERROR | [ ] Missing parameter comment
63 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
69 | ERROR | [x] Expected 1 space before "|"; 0 found
69 | ERROR | [x] Expected 1 space after "|"; 0 found
69 | ERROR | [x] Expected 1 space before "|"; 0 found
69 | ERROR | [x] Expected 1 space after "|"; 0 found
72 | ERROR | [x] Expected 1 blank line after function; 0 found
73 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/nostr_id_nip05/nostr_id_nip05.routing.yml
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
7 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
-----------------------------------------------------------------------------------------------------------------

Time: 75ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig nostr_id_nip05/

Remaining tasks

Patch review

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024