Fix the issues reported by PHP_CodeSniffer

Created on 25 September 2024, about 2 months ago

Problem/Motivation

FILE: modules\simple_feedback\simple_feedback.install
-----------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 9 LINES
-----------------------------------------------------------------------------
12 | ERROR | [x] Short array syntax must be used to define arrays
14 | ERROR | [x] Short array syntax must be used to define arrays
15 | ERROR | [x] Short array syntax must be used to define arrays
21 | ERROR | [x] Short array syntax must be used to define arrays
27 | ERROR | [x] Short array syntax must be used to define arrays
33 | ERROR | [x] Short array syntax must be used to define arrays
40 | ERROR | [x] Short array syntax must be used to define arrays
47 | ERROR | [x] Short array syntax must be used to define arrays
55 | ERROR | [x] Short array syntax must be used to define arrays
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

FILE: modules\simple_feedback\src\Controller\SimpleFeedbackController.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 10 LINES
-----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
2 | ERROR | [x] Expected 7 space(s) before asterisk; 1 found
3 | ERROR | [x] Expected 7 space(s) before asterisk; 1 found
4 | ERROR | [x] Expected 7 space(s) before asterisk; 1 found
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Ajax\AjaxResponse.
30 | ERROR | [ ] Public method name "SimpleFeedbackController::SimpleFeedbackAjaxCallback" is not in lowerCamel format
80 | ERROR | [x] Inline control structures are not allowed
97 | ERROR | [ ] Public method name "SimpleFeedbackController::SimpleFeedbackGetVotesCallback" is not in lowerCamel format
131 | ERROR | [x] Expected 1 blank line after function; 0 found
132 | 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: modules\simple_feedback\src\Plugin\Block\SimpleFeedbackBlock.php
----------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------
24 | ERROR | [x] Short array syntax must be used to define arrays
81 | ERROR | [x] Short array syntax must be used to define arrays
82 | ERROR | [x] Expected 1 blank line after function; 0 found
83 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

Steps to reproduce

Run phpcs command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇺🇸United States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024