Fix 'use' order (new phpcs rule)

Created on 16 November 2023, over 1 year ago

Problem/Motivation

FILE: /Users/a./Documents/Internal/Projects/d10contrib/web/modules/contrib/module_filter/module_filter.module
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
----------------------------------------------------------------------------------------------------------------------

Time: 165ms; Memory: 12MB

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml "module_path"

Proposed resolution

Resolve the PHPCS issues.

📌 Task
Status

Closed: duplicate

Version

4.0

Component

Code

Created by

🇮🇳India shyam_bhatt Gujarat

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

  • Issue created by @shyam_bhatt
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    4 pass
  • 🇮🇳India shyam_bhatt Gujarat

    Here I am adding a solution patch to fix the above issue.

    After applying the patch, run the below code:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml "module_path"

    It will resolve all the issues from phpcs.

  • 🇬🇧United Kingdom jonathan1055

    Thanks Shyam_Bhatt. Yes this is a new sniff added to Coder 8.3.19

  • Status changed to Closed: duplicate over 1 year ago
  • 🇺🇸United States smustgrave

    Going to handle in another ticket and I find these credit farming ones detrimental to the community. Flagging for Drupal association

Production build 0.71.5 2024