Drupal Coding Standards Issues | phpcs

Created on 19 January 2023, almost 2 years ago

Problem/Motivation

Getting following error/warnings

FILE: /var/www/html/modules/contrib/error_page/tests/modules/error_page_test/error_page_test.routing.yml
------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------
6 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
12 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
18 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
26 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/error_page/tests/src/Functional/ErrorPageTest.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
102 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
117 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
134 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
--------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/error_page/src/EventSubscriber/ErrorPageExceptionLoggingSubscriber.php
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------

Time: 1.95 secs; Memory: 6MB

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/terms_of_use/

Proposed resolution

Above error/warnings need to be fixed.

🐛 Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Assigned to Sonal Gyanani
  • Issue was unassigned.
  • Status changed to RTBC almost 2 years ago
Production build 0.71.5 2024