Fix the issues reported by phpcs

Created on 10 July 2023, over 1 year ago
Updated 8 August 2023, over 1 year ago

Problem/Motivation

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

FILE: /var/www/html/vb/d_cont/testfakturoid/readme.md
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
1 | ERROR | [x] Expected 1 newline at end of file; 3 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/testfakturoid/fakturoid_api.install
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
96 | ERROR | [x] Expected 1 newline at end of file; 3 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/testfakturoid/src/Classes/Fakturoid_invoice.php
--------------------------------------------------------------------------------
FOUND 16 ERRORS AND 2 WARNINGS AFFECTING 12 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
5 | ERROR | [x] There must be one blank line after the last USE statement;
| | 3 found;
8 | ERROR | [ ] More than 2 empty lines are not allowed
12 | ERROR | [ ] Class name must use UpperCamel naming without underscores
38 | ERROR | [ ] Parameter $subject is not described in comment
38 | ERROR | [ ] Parameter $custom_id is not described in comment
38 | ERROR | [ ] Parameter $lines is not described in comment
41 | ERROR | [ ] Doc comment for parameter $data does not match actual
| | variable name $lines
48 | ERROR | [x] Short array syntax must be used to define arrays
48 | ERROR | [ ] The array declaration extends to column 127 (the limit is
| | 80). The array content should be split up over multiple
| | lines
48 | ERROR | [x] Expected 1 space between comma and "'custom_id'"; 0 found
48 | ERROR | [x] Expected one space after the comma, 0 found
59 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
81 | ERROR | [x] Missing function doc comment
83 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
91 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE"
| | but found "false"
96 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
127 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL"
| | but found "null"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/testfakturoid/src/Classes/Fakturoid_client.php
--------------------------------------------------------------------------------
FOUND 23 ERRORS AFFECTING 14 LINES
--------------------------------------------------------------------------------
10 | ERROR | [ ] Class name doesn't match filename; expected "class
| | Fakturoid_client"
10 | ERROR | [ ] Class name must begin with a capital letter
10 | ERROR | [ ] Class name must use UpperCamel naming without underscores
19 | ERROR | [ ] Missing member variable doc comment
20 | ERROR | [ ] Class property $api_email should use lowerCamel naming
| | without underscores
20 | ERROR | [ ] Missing member variable doc comment
22 | ERROR | [ ] Class property $api_key should use lowerCamel naming without
| | underscores
22 | ERROR | [ ] Missing member variable doc comment
27 | ERROR | [x] There must be no blank lines after the function comment
30 | ERROR | [x] Expected 1 blank line before function; 2 found
34 | ERROR | [x] The open comment tag must be the only content on the line
34 | ERROR | [x] Doc comment short description must be on the first line
34 | ERROR | [x] Function comment short description must start with exactly
| | one space
34 | ERROR | [x] Doc comment short description must start with a capital
| | letter
35 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
57 | ERROR | [x] Missing function doc comment
57 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
59 | ERROR | [x] Expected 1 blank line after function; 0 found
60 | ERROR | [x] Missing function doc comment
64 | ERROR | [x] Missing function doc comment
64 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
66 | ERROR | [x] Expected 1 blank line after function; 0 found
67 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...www/html/vb/d_cont/testfakturoid/src/Controller/FakturoidApiController.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AND 5 WARNINGS AFFECTING 13 LINES
--------------------------------------------------------------------------------
16 | ERROR | [ ] Missing member variable doc comment
18 | ERROR | [x] Missing function doc comment
22 | ERROR | [x] Missing function doc comment
36 | ERROR | [x] There must be no blank lines after the function comment
40 | WARNING | [x] There must be no blank line following an inline comment
40 | WARNING | [ ] There must be no blank line following an inline comment
44 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
47 | ERROR | [x] Comments may not appear after statements
49 | WARNING | [ ] Unused variable $response.
51 | ERROR | [x] Closing parenthesis of array declaration must be on a new
| | line
54 | WARNING | [ ] Unused variable $response.
56 | ERROR | [x] Closing parenthesis of array declaration must be on a new
| | line
68 | ERROR | [x] Expected 1 blank line after function; 0 found
69 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/testfakturoid/fakturoid_api.routing.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
16 | WARNING | Open page callback found, please add a comment before the line
| | why there is no access restriction
--------------------------------------------------------------------------------

Time: 141ms; 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 testfakturoid/

Remaining tasks

Patch review

📌 Task
Status

Fixed

Version

1.1

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