Drupal Coding Standards Issues | phpcs

Created on 5 December 2022, about 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/flood_control/flood_control.module
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
18 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
18 | ERROR | [x] Closing brace indented incorrectly; expected 6 spaces, found 4
35 | ERROR | [x] Space before opening parenthesis of function call prohibited
44 | ERROR | [x] Expected 1 space after IF keyword; 0 found
44 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
55 | ERROR | [ ] unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
56 | ERROR | [ ] unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/flood_control/src/FloodUnblockManagerInterface.php
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
85 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------

Time: 323ms; Memory: 12MB

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

Proposed resolution

Above error/warnings need to be fixed

๐Ÿ› Bug report
Status

Fixed

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.

Production build 0.71.5 2024