Fix the errors/warnings reported by PHP_CodeSniffer

Created on 15 January 2024, 6 months ago

Problem/Motivation

When running the module code against Drupal coding standards based on Drupal standard, the module shows errors

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml modules/contrib/seo_pager/

Report:

FILE: /home/contribution/drupal/web/modules/contrib/seo_pager/src/SeoPagerService.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------------------------------
  59 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  64 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  65 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  69 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  70 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 103 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------
📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India realsp

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024