- Issue created by @lostcarpark
- 🇮🇪Ireland lostcarpark
PHPCS validation now passing with no issues.
Most of the fixes were adding PHP docblocks.
However, in
src/Drush/Commands/MigrateToolsCommands.php
the issue was long arrays in PHP attributes.First tried splitting these into multiple lines. This fixed the PHPCS issue, but the PREVIOUS_MAJOR test fails, because attributes not supported by PHP7.4.
Added
// phpcs:disable Drupal.Arrays.Array.LongLineDeclaration
to ignore. However, the extra comment made PHPCS think the DocBlock was missing, so had to add// phpcs:disable Drupal.Commenting.FunctionComment.Missing, Squiz.WhiteSpace.FunctionSpacing.Before
to the function declaration to suppress that warning.Hopefully, support for D9 will eventually be dropped from the module, and at that point we should tidy this up.
- Status changed to Needs review
12 months ago 12:10am 28 December 2023 - 🇮🇳India hetal.solanki
I have tested MR 53, and i have found some errors below:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/migrate_tools-3411051/
FILE: /var/www/html/drupal-contribution-d10/web/modules/contrib/migrate_tools-3411051/src/Drush/Commands/MigrateToolsCommands.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 8 LINES
------------------------------------------------------------------------------------------------------------------------------------------
114 | WARNING | Unused variable $group.
481 | WARNING | Unused variable $group_id.
584 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
682 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
758 | ERROR | The array declaration extends to column 102 (the limit is 80). The array content should be split up over multiple lines
863 | ERROR | The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
867 | ERROR | The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
1072 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------------------FILE: /var/www/html/drupal-contribution-d10/web/modules/contrib/migrate_tools-3411051/src/MigrateBatchExecutable.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
300 | WARNING | Unused variable $migration_id.
--------------------------------------------------------------------------------------------------------------------FILE: /var/www/html/drupal-contribution-d10/web/modules/contrib/migrate_tools-3411051/src/Form/MigrationExecuteForm.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
169 | ERROR | The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------FILE: /var/www/html/drupal-contribution-d10/web/modules/contrib/migrate_tools-3411051/tests/modules/migrate_shared_config_test/migrate_shared_config_test.info.yml
------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | WARNING | "Description" property is missing in the info.yml file
------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 🇮🇳India vinmayiswamy
I have tested MR !53 in Drupal version 10.2.x, and confirmed it fixes all the errors reported by phpcs. But we still have a few warnings in the
/src/Controller/MigrationController.php
file.FILE: /Users/vins/projects/drupal102x/drupal/modules/contrib/migrate_tools/src/Controller/MigrationController.php ------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES ------------------------------------------------------------------------------------------------------------------------------ 12 | WARNING | [x] Unused use statement 13 | WARNING | [x] Unused use statement 17 | WARNING | [x] Unused use statement 19 | WARNING | [x] Unused use statement ------------------------------------------------------------------------------------------------------------------------------ PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------------------ Time: 727ms; Memory: 20MB
Thanks!
- First commit to issue fork.
- 🇮🇳India chandansha
i have tested MR 53. i FOUND SOME WARNING. i fixed all of warning using PHPCBF COMMAND.
Thanks!! - Status changed to RTBC
5 months ago 10:00am 22 July 2024 I tested with MR 53. Found these errors. Please check
FILE: ...ontrib/migrate_tools/src/Drush/Commands/MigrateToolsCommands.php
----------------------------------------------------------------------
FOUND 20 ERRORS AFFECTING 10 LINES
----------------------------------------------------------------------
104 | ERROR | [x] The first parameter of a multi-line function
| | declaration must be on the line after the opening
| | bracket
104 | ERROR | [x] Multi-line function declarations must define one
| | parameter per line
108 | ERROR | [x] Multi-line function declarations must have a
| | trailing comma after the last parameter
108 | ERROR | [x] The closing parenthesis of a multi-line function
| | declaration must be on a new line
258 | ERROR | [x] The first parameter of a multi-line function
| | declaration must be on the line after the opening
| | bracket
258 | ERROR | [x] Multi-line function declarations must define one
| | parameter per line
263 | ERROR | [x] Multi-line function declarations must have a
| | trailing comma after the last parameter
263 | ERROR | [x] The closing parenthesis of a multi-line function
| | declaration must be on a new line
453 | ERROR | [x] The first parameter of a multi-line function
| | declaration must be on the line after the opening
| | bracket
453 | ERROR | [x] Multi-line function declarations must define one
| | parameter per line
467 | ERROR | [x] Multi-line function declarations must have a
| | trailing comma after the last parameter
467 | ERROR | [x] The closing parenthesis of a multi-line function
| | declaration must be on a new line
551 | ERROR | [x] The first parameter of a multi-line function
| | declaration must be on the line after the opening
| | bracket
551 | ERROR | [x] Multi-line function declarations must define one
| | parameter per line
560 | ERROR | [x] Multi-line function declarations must have a
| | trailing comma after the last parameter
560 | ERROR | [x] The closing parenthesis of a multi-line function
| | declaration must be on a new line
777 | ERROR | [x] The first parameter of a multi-line function
| | declaration must be on the line after the opening
| | bracket
777 | ERROR | [x] Multi-line function declarations must define one
| | parameter per line
781 | ERROR | [x] Multi-line function declarations must have a
| | trailing comma after the last parameter
781 | ERROR | [x] The closing parenthesis of a multi-line function
| | declaration must be on a new line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 20 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------Time: 4.86 secs; Memory: 20MB