Fix the issues reported by phpcs

Created on 21 April 2023, over 1 year ago
Updated 16 December 2023, about 1 year ago

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

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

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

  • Issue created by @sidharth_soman
  • @sidharth_soman opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

    I've issued an MR for this issue. Please review.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ashutosh ahirwal India

    Ashutosh Ahirwal โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ashutosh ahirwal India

    Updated MR 3 with remaining issue fixes.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The status is also for the issue summary that still needs to be updated as per my previous comment.

  • Assigned to RohitRawat676
  • Status changed to Active over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia RohitRawat676

    try to Fixing Some problem

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arpitk

    Updated Issue summary. Please review.

    Thanks!

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States sgroundwater

    It should be noted that this project required the HAL module which may have hit end of life for D10.
    I'm planning to review this project, to see if it's worth maintaining updates for Drupal 10. It may be possible to achieve similar functionality using the ECA module. (ECA has the potential to serve as a general workflow solution which can replace many single-purpose modules, like this one.)
    Depending on how things play out, this module may morph into ECA plugin for Drupal 10.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    This issue should be probably postponed, to avoid somebody works on it before a decision has been taken about how the module code should be changed.

Production build 0.71.5 2024