Drupal Coding Standards Issues | phpcs

Created on 5 December 2022, almost 2 years ago
Updated 26 February 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/double_field/double_field.module
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------
54 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
82 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: /app/modules/contrib/double_field/src/Plugin/Field/FieldFormatter/Base.php
--------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
81 | WARNING | DateFormat::loadMultiple calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/double_field/src/Plugin/Field/FieldWidget/DoubleField.php
------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------
103 | WARNING | Variable $element inside unset call is undefined.
104 | WARNING | Variable $element inside unset call is undefined.
------------------------------------------------------------------------------------

FILE: /app/modules/contrib/double_field/tests/src/Functional/FieldTypeTest.php
------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------
245 | ERROR | [x] Array indentation error, expected 6 spaces but found 5
246 | ERROR | [x] Array indentation error, expected 6 spaces but found 5
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: /app/modules/contrib/double_field/tests/src/FunctionalJavascript/WidgetTest.php
-------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------
89 | WARNING | [x] There must be no blank line following an inline comment
89 | WARNING | [ ] There must be no blank line following an inline comment
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------

Time: 700ms; Memory: 16MB

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

Proposed resolution

Above error/warnings need to be fixed

๐Ÿ› Bug report
Status

Fixed

Version

4.1

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024