Problem/Motivation
FILE: ...\xampp\htdocs\abc\drupal\modules\current_ip\src\GetCurrentIp.php
----------------------------------------------------------------------
FOUND 26 ERRORS AFFECTING 24 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
25 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
32 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
34 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
35 | ERROR | [x] Expected newline after closing brace
36 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
37 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
37 | ERROR | [x] Expected newline after closing brace
38 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
39 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
41 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
42 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
43 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
45 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
48 | ERROR | [x] Expected 1 newline at end of file; 3 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 26 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...urrent_ip\src\Plugin\Field\FieldFormatter\CurrentIpFormatter.php
----------------------------------------------------------------------
FOUND 69 ERRORS AFFECTING 67 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
32 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
39 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
59 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
60 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
62 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
63 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
65 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
68 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
69 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 12
79 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
81 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
84 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
85 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
87 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
88 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
89 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
91 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
93 | ERROR | [x] Expected 5 space(s) before asterisk; 4 found
94 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
95 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
97 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
99 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
105 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
106 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
108 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
111 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
112 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
113 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
114 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 13
115 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 13
116 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
117 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
118 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
120 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
123 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
124 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
125 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
125 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "NULL" but found "null"
126 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
127 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 12
128 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
130 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
131 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 12
132 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 12
133 | ERROR | [x] Line indented incorrectly; expected 8 spaces,
| | found 16
138 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 12
138 | ERROR | [x] Expected newline after closing brace
139 | ERROR | [x] Line indented incorrectly; expected 8 spaces,
| | found 16
140 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 12
141 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
142 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
143 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
145 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
154 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
155 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
156 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
157 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
162 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
164 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
173 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
174 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
175 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
176 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
177 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
178 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
179 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
181 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 69 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...\modules\current_ip\src\Plugin\Field\FieldType\CurrentIpItem.php
----------------------------------------------------------------------
FOUND 34 ERRORS AFFECTING 34 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
3 | ERROR | [x] Each PHP statement must be on a line by itself
25 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
27 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
30 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
31 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
35 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
40 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
41 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
50 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
55 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
56 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
58 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
59 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 12
60 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 12
61 | ERROR | [x] Array indentation error, expected 14 spaces but
| | found 16
64 | ERROR | [ ] The array declaration extends to column 170 (the
| | limit is 80). The array content should be split up
| | over multiple lines
68 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
70 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
71 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
73 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
76 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
77 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 10
78 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 10
79 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 10
80 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
82 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
85 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
86 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
88 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
98 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
99 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
101 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 33 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...ules\current_ip\src\Plugin\Field\FieldWidget\CurrentIpWidget.php
----------------------------------------------------------------------
FOUND 35 ERRORS AND 1 WARNING AFFECTING 35 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
22 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
27 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
28 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
32 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
34 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
36 | ERROR | [x] Expected 5 space(s) before asterisk; 4 found
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
38 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "TRUE" but found "true"
45 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
51 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 9
52 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
54 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
57 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
58 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
60 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
61 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
62 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
63 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 13
64 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
66 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 8
67 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
69 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
70 | ERROR | [x] Expected 5 space(s) before asterisk; 6 found
72 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
73 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 10
74 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 10
74 | WARNING | [ ] \Drupal calls should be avoided in classes, use
| | dependency injection instead
75 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 10
77 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 10
84 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 12
85 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 12
87 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 12
88 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 4
----------------------------------------------------------------------
PHPCBF CAN FIX THE 35 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 /10.1.x/drupal/modules/contrib/current_ip
Proposed resolution
Fix all the PHP coding standard issues.