Problem/Motivation
When running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .
Following errors/warning are shown related to Coding standards.
FILE: ...endassignment\web\modules\contrib\rules_api_post\config\install\core.entity_form_display.node.api_post.default.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
81 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------
FILE: ...endassignment\web\modules\contrib\rules_api_post\config\install\core.entity_view_display.node.api_post.default.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
36 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------
FILE: ...modules\contrib\rules_api_post\config\install\field.field.node.rules_api_post_transaction.field_content_author.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
18 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------
FILE: ...tdocs\backendassignment\web\modules\contrib\rules_api_post\config\install\node.type.rules_api_post_transaction.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
14 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\rules_api_post\rules_api_post.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\rules_api_post\rules_api_post.module
------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
8 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
8 | ERROR | [x] There must be one blank line after the last USE statement; 0 found;
12 | ERROR | [ ] Invalid function name, expected rules_api_post_help but found rulesApiPostHelp
12 | ERROR | [ ] All functions defined in a module file must be prefixed with the module's name, found
| | "rulesApiPostHelp" but expected "rules_api_post_rulesApiPostHelp"
12 | ERROR | [x] Expected 1 blank line before function; 0 found
17 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\rules_api_post\src\Plugin\RulesAction\RulesAPI_POST.php
------------------------------------------------------------------------------------------------------------------------
FOUND 64 ERRORS AND 6 WARNINGS AFFECTING 46 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
75 | ERROR | [x] Additional blank lines found at end of doc comment
76 | ERROR | [ ] Class name must use UpperCamel naming without underscores
126 | ERROR | [x] Doc comment short description must end with a full stop
148 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
148 | ERROR | [x] No space found before comment text; expected "// protected function doExecute () {" but found
| | "//protected function doExecute () {"
148 | ERROR | [x] Inline comments must start with a capital letter
148 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
| | parentheses
149 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
149 | ERROR | [x] You must use "/**" style comments for a function comment
149 | ERROR | [x] There should be no white space before a closing ")"
149 | ERROR | [x] Expected 0 spaces before closing parenthesis; 1 found
150 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
150 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
| | parentheses
151 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
151 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
153 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
154 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 2
155 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 2
155 | ERROR | [x] There should be no white space before a closing "]"
156 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 2
157 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 3
157 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
| | parentheses
158 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 2
158 | ERROR | [x] There should be no white space before a closing "]"
159 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 2
159 | ERROR | [x] The first index in a multi-value array must be on a new line
160 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
161 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
162 | ERROR | [x] Space after closing parenthesis of function call prohibited
162 | ERROR | [x] Space found before semicolon; expected ");" but found ") ;"
164 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
165 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
165 | ERROR | [x] Expected 1 space after "="; 0 found
166 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
167 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
167 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
168 | WARNING | [ ] Line exceeds 80 characters; contains 97 characters
168 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
169 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
169 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
| | parentheses
170 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
171 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 2
173 | WARNING | [x] A comma should follow the last multiline array item. Found: $apipass
175 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 0
175 | ERROR | [x] Array indentation error, expected 2 spaces but found 0
176 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 0
176 | ERROR | [x] Array indentation error, expected 2 spaces but found 0
177 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 0
177 | ERROR | [x] Array indentation error, expected 2 spaces but found 0
178 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 0
179 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 0
180 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 0
180 | WARNING | [x] A comma should follow the last multiline array item. Found: $apitoken
183 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
184 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
185 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
186 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
187 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
188 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
189 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
190 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
191 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
192 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 2
193 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
193 | ERROR | [x] Closing brace indented incorrectly; expected 0 spaces, found 2
194 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
194 | ERROR | [x] Closing brace indented incorrectly; expected 0 spaces, found 1
194 | ERROR | [x] Expected 1 blank line after function; 0 found
195 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 66 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------
Time: 779ms; Memory: 6MB
Steps to reproduce
Run the phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml . command inside module folder.
Proposed resolution
Work on fixing these errors/warning and Create a patch/MR
Remaining tasks
User interface changes
API changes
Data model changes