Fix the issues reported by phpcs

Created on 18 August 2022, almost 2 years ago
Updated 18 March 2024, 3 months ago

$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml openai_api/

FILE: C:\xampp2\htdocs\creative\web\modules\contrib\openai_api\openai_api.install
--------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
16 | ERROR | [x] Opening brace should be on the same line as the declaration
20 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
24 | WARNING | [x] A comma should follow the last multiline array item. Found: 'OpenAi subjects'
35 | ERROR | [x] Opening brace should be on the same line as the declaration
39 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------

FILE: C:\xampp2\htdocs\creative\web\modules\contrib\openai_api\openai_api.module
---------------------------------------------------------------------------------------
FOUND 23 ERRORS AND 1 WARNING AFFECTING 16 LINES
---------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
10 | ERROR | [ ] Missing short description in doc comment
11 | ERROR | [ ] Missing parameter comment
11 | ERROR | [ ] Missing parameter type
12 | ERROR | [ ] Missing parameter comment
12 | ERROR | [ ] Missing parameter type
13 | ERROR | [ ] Missing parameter comment
13 | ERROR | [ ] Missing parameter type
14 | ERROR | [ ] Missing parameter comment
14 | ERROR | [ ] Missing parameter type
16 | ERROR | [ ] Description for the @return value is missing
19 | ERROR | [x] Empty array declaration must have no space between the parentheses
24 | ERROR | [ ] Missing short description in doc comment
25 | ERROR | [ ] Missing parameter comment
26 | ERROR | [ ] Missing parameter comment
26 | ERROR | [ ] Missing parameter type
32 | ERROR | [x] Opening brace should be on the same line as the declaration
37 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
41 | ERROR | [x] Concat operator must be surrounded by a single space
41 | ERROR | [x] Concat operator must be surrounded by a single space
41 | ERROR | [x] Concat operator must be surrounded by a single space
41 | ERROR | [x] Concat operator must be surrounded by a single space
46 | ERROR | [x] Missing function doc comment
47 | ERROR | [x] Opening brace should be on the same line as the declaration
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------

FILE: C:\xampp2\htdocs\creative\web\modules\contrib\openai_api\openai_api.services.yml
--------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------
7 | ERROR | [x] Expected 1 newline at end of file; 4 found
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: C:\xampp2\htdocs\creative\web\modules\contrib\openai_api\README.md
------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------
27 | WARNING | Line exceeds 80 characters; contains 86 characters
------------------------------------------------------------------------

FILE: C:\xampp2\htdocs\creative\web\modules\contrib\openai_api\src\Controller\OpenAiApiController.php
-----------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 17 LINES
-----------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
15 | ERROR | [ ] Missing short description in doc comment
20 | ERROR | [ ] Missing short description in doc comment
21 | ERROR | [ ] Missing parameter comment
27 | ERROR | [ ] Missing short description in doc comment
28 | ERROR | [ ] Missing parameter comment
30 | ERROR | [ ] Description for the @return value is missing
57 | ERROR | [ ] Missing short description in doc comment
58 | ERROR | [ ] Description for the @return value is missing
75 | ERROR | [ ] Missing short description in doc comment
76 | ERROR | [ ] Description for the @return value is missing
96 | ERROR | [x] Expected 1 blank line after function; 2 found
99 | ERROR | [ ] Missing short description in doc comment
100 | ERROR | [ ] Missing parameter comment
101 | ERROR | [ ] Missing parameter comment
102 | ERROR | [ ] Missing parameter comment
104 | ERROR | [ ] Description for the @return value is missing
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

FILE: C:\xampp2\htdocs\creative\web\modules\contrib\openai_api\src\Form\ApiSettingsForm.php
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
36 | WARNING | [x] A comma should follow the last multiline array item. Found: )
51 | WARNING | [ ] Possible useless method overriding detected
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------

FILE: C:\xampp2\htdocs\creative\web\modules\contrib\openai_api\src\Form\ArticleGenerationConfigForm.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 25 ERRORS AND 7 WARNINGS AFFECTING 22 LINES
-----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
12 | WARNING | [x] Unused use statement
27 | ERROR | [ ] Missing short description in doc comment
32 | ERROR | [ ] Missing short description in doc comment
32 | ERROR | [ ] Parameter $openaiService is not described in comment
63 | ERROR | [ ] Missing short description in doc comment
64 | ERROR | [ ] Description for the @return value is missing
70 | ERROR | [x] Expected one space after the comma, 5 found
70 | ERROR | [x] Comments may not appear after statements
71 | ERROR | [x] Expected one space after the comma, 11 found
71 | ERROR | [x] Comments may not appear after statements
72 | ERROR | [x] Expected one space after the comma, 8 found
72 | ERROR | [x] Comments may not appear after statements
73 | ERROR | [x] Comments may not appear after statements
77 | ERROR | [x] Data types in @var tags need to be fully namespaced
94 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
106 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
106 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
107 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
113 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
113 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
114 | ERROR | [x] Object operator not indented correctly; expected 12 spaces but found 14
121 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
121 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
122 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
146 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
146 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
146 | ERROR | [x] Concat operator must be surrounded by a single space
147 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
147 | WARNING | [x] A comma should follow the last multiline array item. Found: )
167 | ERROR | [x] Space before opening parenthesis of function call prohibited
223 | WARNING | [ ] Possible useless method overriding detected
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp2\htdocs\creative\web\modules\contrib\openai_api\src\OpenaiService.php
----------------------------------------------------------------------------------------------------------------------
FOUND 53 ERRORS AND 2 WARNINGS AFFECTING 53 LINES
----------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
19 | ERROR | [x] Data types in @var tags need to be fully namespaced
23 | ERROR | [ ] Missing short description in doc comment
26 | ERROR | [ ] Class property $api_url should use lowerCamel naming without underscores
28 | ERROR | [ ] Missing short description in doc comment
31 | ERROR | [ ] Class property $api_token should use lowerCamel naming without underscores
33 | ERROR | [ ] Missing short description in doc comment
36 | ERROR | [ ] Class property $api_uri should use lowerCamel naming without underscores
42 | ERROR | [x] Opening brace should be on the same line as the declaration
54 | ERROR | [ ] Missing short description in doc comment
55 | ERROR | [ ] Missing parameter comment
56 | ERROR | [ ] Missing parameter comment
57 | ERROR | [ ] Missing parameter comment
58 | ERROR | [ ] Missing parameter comment
60 | ERROR | [ ] Description for the @return value is missing
64 | ERROR | [x] Opening brace should be on the same line as the declaration
69 | ERROR | [x] Concat operator must be surrounded by a single space
71 | WARNING | [x] A comma should follow the last multiline array item. Found: $temperature
79 | ERROR | [ ] Missing short description in doc comment
80 | ERROR | [ ] Description for the @return value is missing
84 | ERROR | [x] Opening brace should be on the same line as the declaration
94 | ERROR | [ ] Missing parameter comment
94 | ERROR | [ ] Missing parameter type
95 | ERROR | [ ] Missing parameter comment
97 | ERROR | [ ] Description for the @return value is missing
98 | ERROR | [x] Separate the @return and @throws sections by a blank line.
100 | ERROR | [ ] Protected method name "OpenaiService::callAPI" is not in lowerCamel format
101 | ERROR | [x] Opening brace should be on the same line as the declaration
105 | ERROR | [x] Inline comments must start with a capital letter
120 | ERROR | [ ] Missing short description in doc comment
121 | ERROR | [ ] Description for the @return value is missing
124 | ERROR | [x] Opening brace should be on the same line as the declaration
136 | ERROR | [ ] Missing short description in doc comment
137 | ERROR | [ ] Description for the @return value is missing
140 | ERROR | [x] Opening brace should be on the same line as the declaration
144 | ERROR | [ ] Missing short description in doc comment
145 | ERROR | [ ] Description for the @return value is missing
148 | ERROR | [x] Opening brace should be on the same line as the declaration
152 | ERROR | [ ] Missing short description in doc comment
153 | ERROR | [ ] Description for the @return value is missing
156 | ERROR | [x] Opening brace should be on the same line as the declaration
160 | ERROR | [ ] Missing short description in doc comment
161 | ERROR | [ ] Missing parameter comment
164 | ERROR | [x] Opening brace should be on the same line as the declaration
168 | ERROR | [ ] Missing short description in doc comment
169 | ERROR | [ ] Description for the @return value is missing
172 | ERROR | [x] Opening brace should be on the same line as the declaration
176 | ERROR | [ ] Missing short description in doc comment
177 | ERROR | [ ] Missing parameter comment
177 | ERROR | [ ] Missing parameter type
179 | ERROR | [ ] Description for the @return value is missing
182 | ERROR | [x] Opening brace should be on the same line as the declaration
186 | ERROR | [x] Expected 1 blank line after function; 0 found
187 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

Time: 342ms; Memory: 10MB

📌 Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇮🇳India chanchal tiwari

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.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024