Fix the issues reported by phpcs

Created on 3 July 2023, almost 2 years ago
Updated 1 August 2023, over 1 year ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/media_photoswipe/README.txt
------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------
77 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
123 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: ...w/html/vb/d_cont/media_photoswipe/src/Form/MediaPhotoSwipeSettingsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
103 | WARNING | Unused variable $img_folder_path.
133 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
135 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
--------------------------------------------------------------------------------

FILE: ...otoswipe/src/Plugin/Field/FieldFormatter/MediaImagePhotoSwipeFormatter.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
476 | WARNING | ImageStyle::load calls should be avoided in classes, use
| | dependency injection instead
498 | WARNING | ImageStyle::load calls should be avoided in classes, use
| | dependency injection instead
505 | WARNING | ImageStyle::load calls should be avoided in classes, use
| | dependency injection instead
--------------------------------------------------------------------------------

Time: 294ms; Memory: 14MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig media_photoswipe/

Remaining tasks

Patch review

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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