Fix the issues reported by phpcs

Created on 11 July 2023, over 1 year ago
Updated 17 August 2023, over 1 year ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/ai_image/global-styling/aiimg.css
---------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------
2 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
3 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
4 | ERROR | [x] Expected 1 newline at end of file; 3 found
6 | ERROR | [x] Additional whitespace found at end of file
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/js/build/README.txt
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/ai_image.ckeditor5.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
13 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/ai_image.services.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

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

FILE: /var/www/html/vb/d_cont/ai_image/ai_image.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
7 | WARNING | All dependencies must be prefixed with the project name, for
| | example "drupal:"
8 | WARNING | All dependencies must be prefixed with the project name, for
| | example "drupal:"
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/ai_image.links.menu.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
6 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/src/GetAIImage.php
--------------------------------------------------------------------------------
FOUND 34 ERRORS AND 4 WARNINGS AFFECTING 37 LINES
--------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
11 | ERROR | [x] Doc comment short description must end with a full stop
15 | ERROR | [ ] Missing short description in doc comment
18 | ERROR | [ ] Missing @var tag in member variable comment
21 | ERROR | [ ] Missing short description in doc comment
24 | ERROR | [ ] Missing @var tag in member variable comment
30 | ERROR | [x] Additional blank lines found at end of doc comment
36 | ERROR | [x] Doc comment short description must be on the first line
38 | ERROR | [x] Expected "string" but found "String" for parameter type
40 | ERROR | [x] Expected "string" but found "String" for parameter type
42 | ERROR | [x] Expected "string" but found "String" for parameter type
64 | ERROR | [ ] Missing parameter comment
65 | ERROR | [ ] Missing parameter comment
67 | ERROR | [ ] Description for the @return value is missing
84 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
89 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
92 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
100 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
105 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
109 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
117 | ERROR | [ ] Missing parameter comment
118 | ERROR | [ ] Missing parameter comment
120 | ERROR | [ ] Description for the @return value is missing
122 | ERROR | [ ] Private method name "GetAIImage::getOpenAIImage" is not in
| | lowerCamel format
123 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
127 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
130 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
136 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
144 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
156 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
159 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
162 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
175 | ERROR | [x] Missing function doc comment
181 | WARNING | [ ] There must be no blank line following an inline comment
181 | ERROR | [x] Comments may not appear after statements
199 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 26 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/src/Form/AIImgForm.php
--------------------------------------------------------------------------------
FOUND 21 ERRORS AND 2 WARNINGS AFFECTING 16 LINES
--------------------------------------------------------------------------------
27 | ERROR | [x] Expected 1 space after IF keyword; 0 found
28 | ERROR | [x] Short array syntax must be used to define arrays
32 | ERROR | [x] Concat operator must be surrounded by a single space
32 | ERROR | [x] Concat operator must be surrounded by a single space
32 | ERROR | [x] Concat operator must be surrounded by a single space
32 | ERROR | [x] Concat operator must be surrounded by a single space
32 | ERROR | [x] Concat operator must be surrounded by a single space
32 | ERROR | [x] Concat operator must be surrounded by a single space
46 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
47 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
48 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
49 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
50 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
51 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
52 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
54 | ERROR | [x] Line indented incorrectly; expected 5 spaces, found 4
56 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
86 | ERROR | [x] No space found before comment text; expected "//
| | $this->messenger()->addStatus($this->t('The prompt has been
| | sent.'));" but found
| | "//$this->messenger()->addStatus($this->t('The prompt has
| | been sent.'));"
87 | WARNING | [ ] Unused variable $img_url.
89 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
89 | ERROR | [x] No space found before comment text; expected "//
| | $this->messenger()->addStatus($this->t(" | | href=".$img_url.">Image URL"));" but found
| | "//$this->messenger()->addStatus($this->t(" | | href=".$img_url.">Image URL"));"
90 | ERROR | [x] Expected 1 blank line after function; 0 found
91 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 21 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/src/Controller/AIImgController.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
38 | ERROR | [x] Expected 1 space after IF keyword; 0 found
52 | ERROR | [x] Expected 1 blank line after function; 2 found
55 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/src/Plugin/CKEditor5Plugin/AiImage.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
31 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: ]
57 | WARNING | [ ] #options values usually have to run through t() for
| | translation
58 | WARNING | [ ] #options values usually have to run through t() for
| | translation
118 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: ]
119 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: ]
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/ai_image.module
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
8 | ERROR | [x] There must be one blank line after the last USE statement; 2
| | found;
14 | ERROR | [x] Expected 1 blank line before function; 2 found
30 | ERROR | [x] Expected 1 blank line after function; 2 found
38 | ERROR | [x] Expected 1 blank line after function; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 169ms; 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 ai_image/

Remaining tasks

Patch review

📌 Task
Status

Closed: outdated

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