Fix the issues reported by PHPCS

Created on 27 March 2023, over 1 year ago
Updated 13 December 2023, 7 months ago

Problem/Motivation

Fix the issues reported by PHP Code Sniffer for Drupal and Drupal Practice

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig recaptcha/

Proposed resolution

Fix the following issues:
FILE: .../web/modules/contrib/recaptcha/recaptcha.module
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
126 | ERROR | The array declaration extends to column 170 (the limit is 80).
| | The array content should be split up over multiple lines
156 | ERROR | The $_POST super global must not be accessed directly; inject
| | the request.stack service and use
| | $stack->getCurrentRequest()->request->get('g-recaptcha-response')
| | instead
170 | ERROR | The $_POST super global must not be accessed directly; inject
| | the request.stack service and use
| | $stack->getCurrentRequest()->request->get('g-recaptcha-response')
| | instead
222 | ERROR | The array declaration extends to column 198 (the limit is 80).
| | The array content should be split up over multiple lines
222 | ERROR | The array declaration extends to column 177 (the limit is 80).
| | The array content should be split up over multiple lines
--------------------------------------------------------------------------------

FILE: .../web/modules/contrib/recaptcha/tests/src/Functional/ReCaptchaBasicTest.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
152 | ERROR | The array declaration extends to column 229 (the limit is 80).
| | The array content should be split up over multiple lines
172 | ERROR | The array declaration extends to column 232 (the limit is 80).
| | The array content should be split up over multiple lines
178 | ERROR | The array declaration extends to column 120 (the limit is 80).
| | The array content should be split up over multiple lines
184 | ERROR | The array declaration extends to column 120 (the limit is 80).
| | The array content should be split up over multiple lines
--------------------------------------------------------------------------------

FILE: .../web/modules/contrib/recaptcha/src/Form/ReCaptchaAdminSettingsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 613ms; Memory: 10MB

📌 Task
Status

Closed: duplicate

Version

3.0

Component

General

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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