Created on 27 December 2023, 6 months ago
Updated 28 December 2023, 6 months ago

Problem/Motivation

Running PHPCS in the GitLab CI reports the following issues:

FILE: ...60/web/modules/custom/migrate_tools-3410760/tests/src/Kernel/DrushTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 56 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 57 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: ...om/migrate_tools-3410760/tests/src/Functional/MigrateExecutionFormTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 42 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 43 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: ...tests/modules/migrate_tools_test/src/Commands/MigrateToolsTestCommands.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 17 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: ...ules/custom/migrate_tools-3410760/src/MigrateSharedConfigPluginManager.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 50 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...760/web/modules/custom/migrate_tools-3410760/src/MigrateIncludeHandler.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 15 | ERROR | [ ] Missing member variable doc comment
    |       |     (Drupal.Commenting.VariableComment.Missing)
 17 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...3410760/web/modules/custom/migrate_tools-3410760/src/MigrateExecutable.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 85 | ERROR | Missing @var tag in member variable comment
    |       | (Drupal.Commenting.VariableComment.MissingVar)
--------------------------------------------------------------------------------
FILE: ...60/web/modules/custom/migrate_tools-3410760/src/MigrateBatchExecutable.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 43 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 44 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 45 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 46 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: ...60/web/modules/custom/migrate_tools-3410760/src/Routing/RouteProcessor.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 17 | ERROR | [ ] Missing member variable doc comment
    |       |     (Drupal.Commenting.VariableComment.Missing)
 19 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...s/custom/migrate_tools-3410760/src/EventSubscriber/MigrationImportSync.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 22 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: ...igrate_tools-3410760/src/EventSubscriber/MigrationDrushCommandProgress.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 19 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 20 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: ...s/custom/migrate_tools-3410760/src/Drush/Commands/MigrateToolsCommands.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 252 | ERROR | The array declaration extends to column 244 (the limit is 120).
     |       | The array content should be split up over multiple lines
     |       | (Drupal.Arrays.Array.LongLineDeclaration)
 253 | ERROR | The array declaration extends to column 125 (the limit is 120).
     |       | The array content should be split up over multiple lines
     |       | (Drupal.Arrays.Array.LongLineDeclaration)
 751 | ERROR | The array declaration extends to column 186 (the limit is 120).
     |       | The array content should be split up over multiple lines
     |       | (Drupal.Arrays.Array.LongLineDeclaration)
--------------------------------------------------------------------------------
FILE: ...ules/custom/migrate_tools-3410760/src/Discovery/YamlDiscoveryDecorator.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 24 | ERROR | Parameter $file_cache_key_suffix is not described in comment
    |       | (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
 24 | ERROR | Parameter $key is not described in comment
    |       | (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
 29 | ERROR | Doc comment for parameter $name does not match actual variable
    |       | name $key (Drupal.Commenting.FunctionComment.ParamNameNoMatch)
--------------------------------------------------------------------------------
FILE: ...dules/custom/migrate_tools-3410760/src/Controller/MigrationListBuilder.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 29 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 30 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 31 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: ...odules/custom/migrate_tools-3410760/src/Controller/MigrationController.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 26 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 27 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: .../modules/custom/migrate_tools-3410760/src/Controller/MessageController.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 25 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
 26 | ERROR | Missing member variable doc comment
    |       | (Drupal.Commenting.VariableComment.Missing)
--------------------------------------------------------------------------------
FILE: ...ools-3410760/web/modules/custom/migrate_tools-3410760/migrate_tools.module
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must be on the first line
   |       |     (Drupal.Commenting.DocComment.SpacingBeforeShort)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 679ms; Memory: 12MB
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
...b/modules/custom/migrate_tools-3410760/migrate_tools.module  1       0
...custom/migrate_tools-3410760/src/MigrateBatchExecutable.php  4       0
...ules/custom/migrate_tools-3410760/src/MigrateExecutable.php  1       0
.../custom/migrate_tools-3410760/src/MigrateIncludeHandler.php  2       0
...rate_tools-3410760/src/MigrateSharedConfigPluginManager.php  1       0
.../migrate_tools-3410760/src/Controller/MessageController.php  2       0
...igrate_tools-3410760/src/Controller/MigrationController.php  2       0
...grate_tools-3410760/src/Controller/MigrationListBuilder.php  3       0
...rate_tools-3410760/src/Discovery/YamlDiscoveryDecorator.php  3       0
...e_tools-3410760/src/Drush/Commands/MigrateToolsCommands.php  3       0
...10760/src/EventSubscriber/MigrationDrushCommandProgress.php  2       0
...e_tools-3410760/src/EventSubscriber/MigrationImportSync.php  1       0
...custom/migrate_tools-3410760/src/Routing/RouteProcessor.php  2       0
...igrate_tools_test/src/Commands/MigrateToolsTestCommands.php  1       0
...s-3410760/tests/src/Functional/MigrateExecutionFormTest.php  2       0
...custom/migrate_tools-3410760/tests/src/Kernel/DrushTest.php  2       0
--------------------------------------------------------------------------------
A TOTAL OF 32 ERRORS AND 0 WARNINGS WERE FOUND IN 43 FILES
--------------------------------------------------------------------------------
PHPCBF CAN FIX 4 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
----------------------------------------------------------------------
    SOURCE                                                       COUNT
----------------------------------------------------------------------
[ ] Drupal.Commenting.VariableComment.Missing                    21
[ ] Drupal.Arrays.Array.LongLineDeclaration                      3
[x] Drupal.Commenting.FunctionComment.Missing                    3
[ ] Drupal.Commenting.FunctionComment.ParamMissingDefinition     2
[x] Drupal.Commenting.DocComment.SpacingBeforeShort              1
[ ] Drupal.Commenting.FunctionComment.ParamNameNoMatch           1
[ ] Drupal.Commenting.VariableComment.MissingVar                 1
----------------------------------------------------------------------
A TOTAL OF 32 SNIFF VIOLATIONS WERE FOUND IN 7 SOURCES
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SOURCES AUTOMATICALLY (4 VIOLATIONS IN TOTAL)
----------------------------------------------------------------------

Steps to reproduce

Open job log of the following MR:

https://git.drupalcode.org/issue/migrate_tools-3410760/-/jobs/538852

Verify PHPCS failures.

Proposed resolution

Most of the issues are docblock comments. Fill in the missing comments.

Remaining tasks

Make the change.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

📌 Task
Status

Needs review

Version

6.0

Component

Code

Created by

🇮🇪Ireland lostcarpark

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

Merge Requests

Comments & Activities

  • Issue created by @lostcarpark
  • Merge request !53Fixing docblocks. → (Open) 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 6 months ago
Production build 0.69.0 2024