Fix the issues reported by phpcs

Created on 26 April 2023, over 1 year ago
Updated 4 September 2024, 3 months ago

Problem/Motivation

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\css\fun_fact_quiz.css
-----------------------------------------------------------------------------------------------
FOUND 108 ERRORS AFFECTING 92 LINES
-----------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
1 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
1 | ERROR | [x] Additional whitespace found at start of file
2 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
3 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
4 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
7 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
9 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
10 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
10 | ERROR | [x] Whitespace found at end of line
11 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
14 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
15 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
15 | ERROR | [x] Whitespace found at end of line
16 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
20 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
21 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
21 | ERROR | [x] Whitespace found at end of line
22 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
23 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
25 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
26 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
26 | ERROR | [x] Whitespace found at end of line
27 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
29 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
30 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
30 | ERROR | [x] Whitespace found at end of line
31 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
32 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
35 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
36 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
38 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
39 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
40 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
42 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
43 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
43 | ERROR | [x] Whitespace found at end of line
44 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
47 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
48 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
49 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
51 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
52 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
53 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
53 | ERROR | [x] Whitespace found at end of line
54 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
55 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
56 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
57 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
58 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
59 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
60 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
61 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
62 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
63 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
63 | ERROR | [x] Whitespace found at end of line
64 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 3
65 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
66 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
67 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
68 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
69 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
70 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
70 | ERROR | [x] Whitespace found at end of line
71 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
72 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
72 | ERROR | [x] Whitespace found at end of line
73 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
74 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
75 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
76 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
77 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
78 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
78 | ERROR | [x] Whitespace found at end of line
79 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
81 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
82 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
83 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
84 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
84 | ERROR | [x] Whitespace found at end of line
85 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
86 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
87 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
88 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
89 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
90 | ERROR | [x] Blank lines are not allowed in class definitions
90 | ERROR | [x] Whitespace found at end of line
91 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
92 | ERROR | [x] Expected 1 newline at end of file; 0 found
92 | ERROR | [x] Additional whitespace found at end of file
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 108 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\fun_fact_quiz.info.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: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\fun_fact_quiz.install
-----------------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 11 LINES
-----------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
5 | ERROR | [x] Expected 1 blank line before function; 0 found
6 | ERROR | [x] Short array syntax must be used to define arrays
8 | ERROR | [x] Short array syntax must be used to define arrays
9 | ERROR | [x] Short array syntax must be used to define arrays
15 | ERROR | [x] Short array syntax must be used to define arrays
20 | ERROR | [x] Short array syntax must be used to define arrays
25 | ERROR | [x] Short array syntax must be used to define arrays
30 | ERROR | [x] Short array syntax must be used to define arrays
35 | ERROR | [x] Short array syntax must be used to define arrays
41 | ERROR | [x] Short array syntax must be used to define arrays
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\fun_fact_quiz.links.menu.yml
------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 6 found
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\fun_fact_quiz.module
----------------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | ERROR | [x] Short array syntax must be used to define arrays
8 | ERROR | [x] Short array syntax must be used to define arrays
9 | ERROR | [x] Short array syntax must be used to define arrays
11 | ERROR | [x] Expected 1 space before "=>"; 0 found
11 | ERROR | [x] Expected 1 space after "=>"; 0 found
12 | ERROR | [x] Short array syntax must be used to define arrays
18 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\fun_fact_quiz.routing.yml
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
40 | ERROR | [x] Expected 1 newline at end of file; 11 found
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\README.md
-----------------------------------------------------------------------------------
FOUND 1 ERROR AND 5 WARNINGS AFFECTING 6 LINES
-----------------------------------------------------------------------------------
3 | WARNING | [ ] Line exceeds 80 characters; contains 128 characters
5 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
25 | WARNING | [ ] Line exceeds 80 characters; contains 111 characters
27 | WARNING | [ ] Line exceeds 80 characters; contains 123 characters
29 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
35 | 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\fun_fact_quiz\src\Controller\FunFactQuizController.php
------------------------------------------------------------------------------------------------------------------------
FOUND 21 ERRORS AND 3 WARNINGS AFFECTING 22 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
3 | ERROR | [x] There must be one blank line after the namespace declaration
4 | WARNING | [x] Unused use statement
5 | ERROR | [x] There must be one blank line after the last USE statement; 0 found;
6 | ERROR | [x] Missing class doc comment
7 | ERROR | [x] Missing function doc comment
7 | ERROR | [x] Expected 1 blank line before function; 0 found
7 | ERROR | [x] Whitespace found at end of line
8 | ERROR | [x] Opening brace should be on the same line as the declaration
10 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
12 | ERROR | [ ] The array declaration extends to column 84 (the limit is 80). The array content should be split up
| | over multiple lines
23 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
24 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
25 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
28 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
29 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
32 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
| | parentheses
37 | ERROR | [x] Whitespace found at end of line
40 | ERROR | [x] Whitespace found at end of line
49 | ERROR | [x] Whitespace found at end of line
53 | ERROR | [x] Whitespace found at end of line
54 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
59 | ERROR | [x] Whitespace found at end of line
60 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 21 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: ...\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\src\Controller\FunFactQuizDeleteQuestionController.php
------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
3 | ERROR | [x] There must be one blank line after the namespace declaration
7 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\src\Controller\QuizController.php
------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | WARNING | [x] Unused use statement
9 | ERROR | [x] Missing class doc comment
11 | ERROR | [x] Missing function doc comment
16 | ERROR | [ ] The array declaration extends to column 90 (the limit is 80). The array content should be split up
| | over multiple lines
43 | WARNING | [ ] Unused variable $table.
59 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\src\Form\AddQuestionForm.php
------------------------------------------------------------------------------------------------------------------------
FOUND 64 ERRORS AND 8 WARNINGS AFFECTING 62 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | WARNING | [x] Unused use statement
15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
17 | ERROR | [x] Whitespace found at end of line
22 | ERROR | [x] Expected 1 blank line before function; 2 found
30 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 1
31 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 1
32 | ERROR | [x] Whitespace found at end of line
33 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
34 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
35 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
36 | ERROR | [ ] The array declaration extends to column 89 (the limit is 80). The array content should be split up
| | over multiple lines
39 | ERROR | [x] Inline comments must start with a capital letter
40 | ERROR | [ ] Comment indentation error, expected only 1 spaces
42 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
| | parentheses
43 | ERROR | [x] Closing brace indented incorrectly; expected 5 spaces, found 4
44 | ERROR | [x] Whitespace found at end of line
45 | ERROR | [x] Short array syntax must be used to define arrays
45 | ERROR | [x] Whitespace found at end of line
47 | ERROR | [x] Short array syntax must be used to define arrays
55 | ERROR | [x] Short array syntax must be used to define arrays
62 | ERROR | [x] Short array syntax must be used to define arrays
69 | ERROR | [x] Short array syntax must be used to define arrays
77 | ERROR | [x] Short array syntax must be used to define arrays
84 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
84 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
85 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
86 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
90 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
92 | ERROR | [x] Short array syntax must be used to define arrays
110 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
111 | ERROR | [x] Whitespace found at end of line
112 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
113 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
113 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
114 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
115 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
116 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
123 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 6
124 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 6
126 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
127 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
127 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
128 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
129 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
130 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 5
131 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 5
132 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 5
134 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
135 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
136 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
137 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
144 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 6
146 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
147 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
147 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
148 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
149 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 5
150 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 9
151 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 9
152 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 9
153 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 9
154 | ERROR | [x] Whitespace found at end of line
154 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
155 | ERROR | [x] Whitespace found at end of line
156 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
158 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
158 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 0
158 | ERROR | [x] Whitespace found at end of line
159 | ERROR | [x] Expected 1 newline at end of file; 0 found
159 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 63 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\fun_fact_quiz\src\Form\ListQuestionsForm.php
------------------------------------------------------------------------------------------------------------------------
FOUND 36 ERRORS AND 4 WARNINGS AFFECTING 26 LINES
------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
8 | WARNING | [x] Unused use statement
8 | ERROR | [x] There must be one blank line after the last USE statement; 0 found;
13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
15 | ERROR | [x] Whitespace found at end of line
20 | ERROR | [x] Expected 1 blank line before function; 2 found
29 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
30 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
37 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
38 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
38 | ERROR | [x] There should be no white space after an opening "["
38 | ERROR | [x] The first index in a multi-value array must be on a new line
38 | ERROR | [x] Expected one space after the comma, 2 found
38 | ERROR | [x] Each index in a multi-line array must be on a new line
38 | ERROR | [x] Expected one space after the comma, 2 found
38 | ERROR | [x] Each index in a multi-line array must be on a new line
38 | ERROR | [x] Expected one space after the comma, 2 found
38 | ERROR | [x] Each index in a multi-line array must be on a new line
38 | ERROR | [ ] The array declaration extends to column 201 (the limit is 80). The array content should be split up
| | over multiple lines
38 | ERROR | [ ] The array declaration extends to column 200 (the limit is 80). The array content should be split up
| | over multiple lines
39 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
39 | ERROR | [x] There should be no white space after an opening "["
39 | ERROR | [x] The first index in a multi-value array must be on a new line
41 | ERROR | [x] Array closing indentation error, expected 8 spaces but found 6
44 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
46 | ERROR | [ ] The array declaration extends to column 90 (the limit is 80). The array content should be split up
| | over multiple lines
49 | ERROR | [x] Whitespace found at end of line
59 | WARNING | [x] A comma should follow the last multiline array item. Found: )
61 | ERROR | [x] Whitespace found at end of line
65 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
65 | ERROR | [x] 3 spaces found before inline comment; expected "// dump($id);" but found "// dump($id);"
72 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
73 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
87 | ERROR | [x] Expected 3 space(s) before asterisk; 1 found
88 | ERROR | [x] Expected 3 space(s) before asterisk; 1 found
89 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
90 | ERROR | [x] Whitespace found at end of line
91 | ERROR | [x] Closing brace indented incorrectly; expected 0 spaces, found 2
92 | ERROR | [x] Whitespace found at end of line
93 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 35 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

Time: 1.6 secs; Memory: 6MB

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

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

    All issues fixed except for dependency injection and documentation warnings. Keeping them as it is for readability purposes.

    Please review the above MR.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I do not have time to make a complete review, but this type of changes is wrong: Periods are not added to commented out code.

    -    // $question_index = rand(0, count($questions) - 1);
    +    // $question_index = rand(0, count($questions) - 1);.
  • Status changed to Needs work 3 months ago
  • Hi @sidharth_soman,

    These are the issues reported after MR!1 was merged (I was not the one who merged it). Please see below:

    ➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig fun_fact_quiz
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/fun_fact_quiz/README.md
    ---------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
    ---------------------------------------------------------------------------------------------------
      3 | WARNING | Line exceeds 80 characters; contains 128 characters
      5 | WARNING | Line exceeds 80 characters; contains 92 characters
     25 | WARNING | Line exceeds 80 characters; contains 111 characters
     27 | WARNING | Line exceeds 80 characters; contains 123 characters
     29 | WARNING | Line exceeds 80 characters; contains 89 characters
    ---------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/fun_fact_quiz/src/Form/AddQuestionForm.php
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 7 WARNINGS AFFECTING 8 LINES
    ----------------------------------------------------------------------------------------------------------------------
      14 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
      31 | WARNING | Line exceeds 80 characters; contains 81 characters
      33 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      38 | ERROR   | Comment indentation error, expected only 1 spaces
      82 | WARNING | Line exceeds 80 characters; contains 86 characters
     110 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     124 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     144 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/fun_fact_quiz/src/Form/ListQuestionsForm.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
    ------------------------------------------------------------------------------------------------------------------------
      6 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormBase.
     14 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
     49 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/fun_fact_quiz/src/Controller/FunFactQuizController.php
    ----------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------------------------------------------------------------------
      7 | ERROR   | Doc comment is empty
     12 | ERROR   | Doc comment is empty
     17 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     61 | WARNING | Line exceeds 80 characters; contains 90 characters
    ----------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/fun_fact_quiz/src/Controller/QuizController.php
    ---------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
    ---------------------------------------------------------------------------------------------------------------------------
      8 | ERROR   | Doc comment is empty
     13 | ERROR   | Doc comment is empty
     48 | WARNING | Unused variable $table.
    ---------------------------------------------------------------------------------------------------------------------------
    
    Time: 240ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • Status changed to Fixed 3 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    MR !1 has been already merged.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024