Fix 'use' order (new phpcs rule)

Created on 16 November 2023, 7 months ago
Updated 20 November 2023, 7 months ago

Problem/Motivation

FILE: ../d10contrib/web/modules/contrib/image_auto_alt_filter/image_auto_alt_filter.info.yml
-------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------
 5 | ERROR | [x] Expected 1 newline at end of file; 2 found
-------------------------------------------------------------------------------------------------------------------------------

FILE: ../d10contrib/web/modules/contrib/image_auto_alt_filter/src/Plugin/Filter/ImageAutoAlt.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
 10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is DonatelloZa\RakePlus\RakePlus.
-----------------------------------------------------------------------------------------------------------------------------------

Time: 91ms; Memory: 10MB

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: works as designed

Version

1.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 7 months ago
  • 🇮🇳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.

    A new sniff added to Coder 8.3.19 →

  • Status changed to Closed: works as designed 7 months ago
  • 🇮🇳India Shyam_Bhatt Gujarat

    I think the maintainer can use phpcbf and resolve similar issues. Hence, I am closing this issue.

Production build 0.69.0 2024