Fix the issues reported by phpcs

Created on 27 March 2024, 8 months ago
Updated 6 August 2024, 3 months ago

Problem/Motivation

There is a file that needs to be fixed with coding standards.
Here is the command: -
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml web/modules/contrib/link_obfuscation/

FILE: D:\wamp64\www\drupal10\modules\contrib\link_obfuscation\js\link_obfuscation.js
---------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------
  6 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 22 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 46 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: D:\wamp64\www\drupal10\modules\contrib\link_obfuscation\link_obfuscation.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------


FILE: D:\wamp64\www\drupal10\modules\contrib\link_obfuscation\link_obfuscation.module
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------
  8 | WARNING | [x] Unused use statement
  9 | WARNING | [x] Unused use statement
 10 | WARNING | [x] Unused use statement
 10 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Block\BlockPluginInterface.
 10 | ERROR   | [x] There must be one blank line after the last USE statement; 2 found;
 16 | ERROR   | [x] Expected 1 blank line before function; 2 found
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------


FILE: D:\wamp64\www\drupal10\modules\contrib\link_obfuscation\src\Service\ObfuscateLinkGenerator.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Render\MarkupInterface.
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------

Time: 1.9 secs; Memory: 12MB

Steps to reproduce

Run PHPCS on Link Obfuscation module.

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India amanbtr72

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.71.5 2024