Fix the issues reported by phpcs

Created on 21 March 2023, over 1 year ago
Updated 29 February 2024, 4 months ago

Problem/Motivation

Getting following error/warnings.

FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\representative_image\src\Plugin\Field\FieldFormatter\EntityReferenceRepresentativeImage.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------
82 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
----------------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\representative_image\src\Plugin\migrate\source\FieldConfig.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
42 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
-------------------------------------------------------------------------------------------------------------------------------------------

Time: 421ms; 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/representative_image/

Proposed resolution

Above error/warnings need to be fixed

📌 Task
Status

Needs work

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