Fix the issues reported by phpcs

Created on 1 March 2023, over 1 year ago
Updated 2 March 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/block_country/README.txt
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
64 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/block_country/block_country.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/block_country/src/Plugin/Condition/BlockCountry.php
----------------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 12 LINES
----------------------------------------------------------------------------------------------
53 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
91 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "True"
113 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "False"
114 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "True"
115 | ERROR | [x] Expected newline after closing brace
117 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
119 | ERROR | [x] Expected 1 space after closing parenthesis; found 2
120 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
122 | ERROR | [x] Expected newline after closing brace
123 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
134 | ERROR | [x] Expected 1 blank line after function; 2 found
141 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
141 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

Time: 1.16 secs; Memory: 6MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/block_country/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

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.69.0 2024