Drupal Coding Standards Issues | phpcs

Created on 27 December 2022, over 1 year ago
Updated 16 January 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/paragraph_view_mode/paragraph_view_mode.module
----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------
67 | WARNING | Only string literals should be passed to t() where possible
----------------------------------------------------------------------------

FILE: /app/modules/contrib/paragraph_view_mode/src/Plugin/Field/FieldWidget/ParagraphViewModeWidget.php
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
144 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/paragraph_view_mode/src/StorageManager.php
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------
197 | WARNING | Only string literals should be passed to t() where possible
-----------------------------------------------------------------------------

FILE: /app/modules/contrib/paragraph_view_mode/src/StorageManagerInterface.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
28 | ERROR | [x] PHP keywords must be lowercase; expected "self" but found "SELF"
33 | ERROR | [x] PHP keywords must be lowercase; expected "self" but found "SELF"
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------

Time: 1.97 secs; Memory: 12MB

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

Proposed resolution

Above error/warnings need to be fixed

🐛 Bug report
Status

Fixed

Version

3.0

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