Fix Use Statements Sorting in Files to Media Migrate Module

Created on 7 March 2024, 4 months ago
Updated 23 May 2024, about 1 month ago

Issue Summary:
The Files to Media Migrate module contains a use statement sorting violation, identified using PHP_CodeSniffer. This issue aims to correct the sorting of use statements in the affected file to adhere to Drupal coding standards.

Details:

Affected File:

src/Commands/FilesToMediaMigrate.php
Error Description:

The use statements are not sorted alphabetically.
The first affected use statement is Drupal\field\Entity\FieldStorageConfig.
Automated Fix Available:

PHP_CodeSniffer reports 1 error and suggests an automatic fix using PHPCBF.
Steps to Reproduce:

Run PHP_CodeSniffer on the Files to Media Migrate module using the Drupal coding standards.
Observe the reported error related to the sorting of use statements.

The warnings in the files_to_media_migrate.info.yml file are related to information that will be added automatically during drupal.org packaging and can be safely ignored.

Referred source
when I run the command
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml ./web/modules/contrib/files_to_media_migrate/
I found this

FILE: ...es/contrib/files_to_media_migrate/src/Commands/FilesToMediaMigrate.php
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\field\Entity\FieldStorageConfig.
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------

FILE: ...modules/contrib/files_to_media_migrate/files_to_media_migrate.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
----------------------------------------------------

I Created following patch for this

๐Ÿ“Œ Task
Status

Active

Version

1.0

Component

Miscellaneous

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Harpreet_singh_saluja

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024