Fix the errors/warnings reported by Php_CodeSniffer

Created on 4 July 2023, 12 months ago

Problem/Motivation

The phpcs command picks up on errors in these two files:

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\pager\src\PagerStorage.php
--------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 11 | ERROR | [ ] Missing member variable doc comment
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\pager\src\Plugin\Block\PagerBlock.php
--------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 3 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  26 | ERROR   | [ ] Missing member variable doc comment
  27 | ERROR   | [ ] Missing member variable doc comment
  28 | ERROR   | [ ] Missing member variable doc comment
  29 | ERROR   | [ ] Missing member variable doc comment
 323 | ERROR   | [ ] unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 353 | WARNING | [ ] ImageStyle::load calls should be avoided in classes, use dependency injection instead
 377 | WARNING | [ ] ImageStyle::loadMultiple calls should be avoided in classes, use dependency injection instead
 399 | WARNING | [ ] ImageStyle::load calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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