Running CodeSniffer reports a few minor Drupal coding standards.
/phone_registration/phone_registration.module
----------------------------------------------------------------------------------------------------
FOUND 84 ERRORS AND 1 WARNING AFFECTING 38 LINES
----------------------------------------------------------------------------------------------------
36 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
36 | ERROR | [x] Inline comments must start with a capital letter
36 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks,
| | colons, or closing parentheses
37 | ERROR | [x] Expected 1 space after IF keyword; 0 found
37 | ERROR | [x] Expected 1 space before "=="; 0 found
37 | ERROR | [x] Expected 1 space after "=="; 0 found
37 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
37 | ERROR | [x] Whitespace found at end of line
38 | ERROR | [x] Expected 1 space before "="; 0 found
38 | ERROR | [x] Expected 1 space after "="; 0 found
40 | ERROR | [x] Expected 1 space before "="; 0 found
40 | ERROR | [x] Expected 1 space after "="; 0 found
41 | ERROR | [x] Expected 1 space before "="; 0 found
41 | ERROR | [x] Expected 1 space after "="; 0 found
42 | ERROR | [x] Expected 1 space before "="; 0 found
42 | ERROR | [x] Expected 1 space after "="; 0 found
43 | ERROR | [x] Expected 1 space before "="; 0 found
43 | ERROR | [x] Expected 1 space after "="; 0 found
44 | ERROR | [x] Expected 1 space before "="; 0 found
44 | ERROR | [x] Expected 1 space after "="; 0 found
45 | ERROR | [x] Expected 1 space before "="; 0 found
45 | ERROR | [x] Expected 1 space after "="; 0 found
46 | ERROR | [x] Expected 1 space before "="; 0 found
46 | ERROR | [x] Expected 1 space after "="; 0 found
50 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
50 | ERROR | [x] Inline comments must start with a capital letter
50 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks,
| | colons, or closing parentheses
51 | ERROR | [x] Expected 1 space after IF keyword; 0 found
51 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
61 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
62 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
63 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
66 | ERROR | [x] Expected 1 space after IF keyword; 0 found
66 | ERROR | [x] Expected 1 space before "=="; 0 found
66 | ERROR | [x] Expected 1 space after "=="; 0 found
66 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
67 | ERROR | [x] Expected 1 space before "="; 0 found
67 | ERROR | [x] Expected 1 space after "="; 0 found
68 | ERROR | [x] Expected 1 space before "="; 0 found
68 | ERROR | [x] Expected 1 space after "="; 0 found
77 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
77 | ERROR | [x] Inline comments must start with a capital letter
77 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks,
| | colons, or closing parentheses
78 | ERROR | [x] Expected 1 space after IF keyword; 0 found
78 | ERROR | [x] Expected 1 space before "=="; 0 found
78 | ERROR | [x] Expected 1 space after "=="; 0 found
78 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
78 | ERROR | [x] Whitespace found at end of line
79 | ERROR | [x] Expected 1 space before "="; 0 found
79 | ERROR | [x] Expected 1 space after "="; 0 found
80 | ERROR | [x] Expected one space after the comma, 0 found
86 | ERROR | [x] Hook implementations must be documented with "Implements hook_example()."
90 | ERROR | [x] Expected 1 space after IF keyword; 0 found
90 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
91 | ERROR | [x] Expected 1 space after IF keyword; 0 found
91 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
92 | ERROR | [x] Expected 1 space after IF keyword; 0 found
92 | ERROR | [x] Expected 1 space before ">"; 0 found
92 | ERROR | [x] Expected 1 space after ">"; 0 found
92 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
95 | ERROR | [x] Expected newline after closing brace
98 | ERROR | [x] Expected newline after closing brace
105 | ERROR | [x] Hook implementations must be documented with "Implements hook_example()."
121 | ERROR | [x] Expected 1 space after IF keyword; 0 found
121 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
123 | ERROR | [x] Expected 1 space after IF keyword; 0 found
123 | ERROR | [x] There should be no white space before a closing ")"
123 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
125 | ERROR | [x] Expected 1 space after IF keyword; 0 found
125 | ERROR | [x] Expected one space after the comma, 0 found
125 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
126 | ERROR | [x] Expected 1 space after IF keyword; 0 found
126 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
127 | ERROR | [x] Expected 1 space after IF keyword; 0 found
127 | ERROR | [x] Expected 1 space before ">"; 0 found
127 | ERROR | [x] Expected 1 space after ">"; 0 found
127 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
132 | ERROR | [x] Expected newline after closing brace
133 | ERROR | [x] Expected 1 space after IF keyword; 0 found
133 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
134 | ERROR | [x] Expected 1 space after IF keyword; 0 found
134 | ERROR | [x] Expected 1 space before ">"; 0 found
134 | ERROR | [x] Expected 1 space after ">"; 0 found
134 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
139 | ERROR | [x] Expected newline after closing brace
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 84 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------
FILE: /phone_registration/phone_registration.info.yml
------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------
6 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------
FILE: /phone_registration/README.md
-----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------
16 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
31 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------
FILE: /phone_registration/phone_registration.libraries.yml
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------
Time: 58ms; Memory: 8MB
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3071779-4.patch | 0 bytes | priyanka2095 |
| #3 | phone_registration_3071779.patch | 7.93 KB | purvitagupta |
Comments
Comment #2
purvitagupta commentedComment #3
purvitagupta commentedHi here is the patch
Comment #4
priyanka2095 commentedI tried to apply patch 'phone_registration_3071779.patch' but failed, so I created a new patch.
Comment #5
gislePatch in #3 applies cleanly except for some whitespace errors.
Patch in #4 is empty.
Note: I haven't reviewed the code patch in #3, just checked if it applies.
Unassiging priyanka2095 as the assertion in #4 about the patch in #3 "failed" is misleading and not constructive.
Comment #7
gaurav.kapoor commentedFixed CS issues using coder.