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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3329744-2.patch | 2.47 KB | samitk |
Comments
Comment #2
samitk commentedError/warnings are fixed.
Comment #4
sayco commentedComment #5
sayco commentedThank you for improving the coding standards! I've merged the patch to the dev branch.