Fix the issues reported by phpcs

Created on 15 June 2023, about 1 year ago
Updated 22 February 2024, 4 months ago

Problem/Motivation

Getting following error/warnings:

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\password_policy\password_policy_history\password_policy_history.module
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
32 | ERROR | The $_POST super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->request->get('pass') instead
32 | ERROR | The $_POST super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->request->get('pass') instead
-------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\password_policy\README.md
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------
54 | WARNING | Line exceeds 80 characters; contains 115 characters
-----------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\password_policy\src\Plugin\migrate\process\PolicyConfiguration.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
190 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
--------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run following command:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml password_policy/

Proposed resolution

Above error/warnings need to be fixed

📌 Task
Status

Closed: duplicate

Version

4.0

Component

Code

Created by

🇮🇳India arti_parmar

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