Drupal Coding Standards Issues | phpcs

Created on 7 March 2023, over 1 year ago
Updated 6 October 2023, 12 months ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/views_vcards/tests/modules/views_vcards_test/views_vcards_test.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/views_vcards/src/Plugin/views/row/ViewsVcardsRowPluginVcard.php
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
463 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_vcards/src/Plugin/views/display/ViewsVcardsDisplayPluginVcard.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
205 | WARNING | Unused variable $row_index.
329 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

Time: 3.29 secs; Memory: 8MB

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

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
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.71.5 2024