Drupal Coding Standards Issues | phpcs

Created on 8 February 2023, over 1 year ago
Updated 19 April 2023, about 1 year ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/datafield/datafield.info.yml
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
----------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/datafield/datafield.module
--------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------
33 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
55 | ERROR | [x] Expected 1 space after "=>"; 2 found
93 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
99 | ERROR | [x] Expected 1 space before "=>"; 0 found
99 | ERROR | [x] Expected 1 space after "=>"; 0 found
99 | WARNING | [ ] Unused variable $index.
99 | ERROR | [x] Expected 1 space before "=>"; 0 found
99 | ERROR | [x] Expected 1 space after "=>"; 0 found
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------

Time: 5.2 secs; Memory: 14MB

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/datafield/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Fixed

Version

1.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