Fix the issues reported by phpcs

Created on 25 January 2023, over 1 year ago
Updated 26 February 2024, 4 months ago

Problem/Motivation

There are multiple PHPCS issues in this module, which should be fixed!

NOTE, that most of these problems are related to 🐛 Fix Drush Commands Closed: outdated , so this issue should be resolved first.

FILE: ~/projects/drupal-d10/modules/contrib/config_partial_export/config_partial_export.drush.inc
-----------------------------------------
FOUND 10 ERRORS AFFECTING 9 LINES
-----------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR | [x] Missing file doc comment
 46 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 47 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 48 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 49 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 50 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 51 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 52 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 53 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
-----------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/config_partial_export/config_partial_export.module
-----------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------
 22 | ERROR | [x] Short array syntax must be used to define arrays
-----------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/config_partial_export/config_partial_export.info.yml
-----------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/config_partial_export/src/Form/ConfigPartialExportForm.php
-----------------------------------------
FOUND 10 ERRORS AFFECTING 9 LINES
-----------------------------------------
  76 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  77 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  78 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  79 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  80 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  81 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
  81 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 6
 219 | ERROR | [x] Concat operator must be surrounded by a single space
 230 | ERROR | [x] Expected 1 blank line after function; 0 found
 231 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/config_partial_export/src/Commands/ConfigPartialExportCommands.php
-----------------------------------------
FOUND 77 ERRORS AND 5 WARNINGS AFFECTING 56 LINES
-----------------------------------------
  16 | WARNING | [x] Unused use statement
  24 | ERROR   | [ ] Missing short description in doc comment
  25 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  29 | ERROR   | [ ] Missing member variable doc comment
  31 | ERROR   | [ ] Missing member variable doc comment
  33 | ERROR   | [ ] Missing member variable doc comment
  35 | ERROR   | [ ] Missing member variable doc comment
  37 | ERROR   | [ ] Missing member variable doc comment
  39 | ERROR   | [ ] Missing member variable doc comment
  41 | ERROR   | [ ] Missing member variable doc comment
  43 | ERROR   | [ ] Missing member variable doc comment
  45 | ERROR   | [ ] Missing short description in doc comment
  51 | ERROR   | [ ] Missing short description in doc comment
  51 | ERROR   | [ ] Parameter $moduleHandler is not described in comment
  51 | ERROR   | [ ] Parameter $eventDispatcher is not described in comment
  51 | ERROR   | [ ] Parameter $lock is not described in comment
  51 | ERROR   | [ ] Parameter $configTyped is not described in comment
  51 | ERROR   | [ ] Parameter $moduleInstaller is not described in comment
  51 | ERROR   | [ ] Parameter $themeHandler is not described in comment
  51 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
  52 | ERROR   | [ ] Missing parameter comment
  52 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  53 | ERROR   | [ ] Missing parameter comment
  53 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  54 | ERROR   | [ ] Missing parameter comment
  54 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  56 | ERROR   | [x] Expected 1 blank line before function; 2 found
  57 | ERROR   | [x] Opening brace should be on the same line as the declaration
  74 | ERROR   | [ ] Missing parameter type
  76 | ERROR   | [ ] Missing parameter type
  77 | WARNING | [ ] Line exceeds 80 characters; contains 112 characters
  79 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
  80 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
  81 | ERROR   | [x] Separate the @param and @option sections by a blank line.
  94 | ERROR   | [ ] Type hint "array" missing for $options
  94 | ERROR   | [ ] The array declaration extends to column 136 (the limit is 80). The array content should be split up over multiple lines
 154 | ERROR   | [x] Expected 1 blank line after function; 3 found
 157 | ERROR   | [ ] More than 2 empty lines are not allowed
 158 | ERROR   | [ ] Parameter $destination_dir is not described in comment
 171 | ERROR   | [x] Visibility must be declared on method "_config_partial_export_write_config"
 171 | ERROR   | [ ] Method name "ConfigPartialExportCommands::_config_partial_export_write_config" is not in lowerCamel format
 198 | ERROR   | [x] Visibility must be declared on method "_config_partial_export_get_wildcard_keys"
 198 | ERROR   | [ ] Method name "ConfigPartialExportCommands::_config_partial_export_get_wildcard_keys" is not in lowerCamel format
 219 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 236 | ERROR   | [x] Visibility must be declared on method "_config_partial_export_get_changes"
 236 | ERROR   | [ ] Method name "ConfigPartialExportCommands::_config_partial_export_get_changes" is not in lowerCamel format
 259 | ERROR   | [ ] Missing short description in doc comment
 260 | ERROR   | [ ] Missing parameter comment
 261 | ERROR   | [ ] Description for the @return value is missing
 263 | ERROR   | [x] Visibility must be declared on method "_user_abort"
 263 | ERROR   | [ ] Method name "ConfigPartialExportCommands::_user_abort" is not in lowerCamel format
 263 | ERROR   | [ ] Type hint "null" missing for $msg
 269 | ERROR   | [ ] Missing short description in doc comment
 270 | ERROR   | [ ] Missing parameter comment
 270 | ERROR   | [ ] Missing parameter type
 271 | ERROR   | [ ] Missing parameter comment
 272 | ERROR   | [ ] Missing parameter comment
 273 | ERROR   | [ ] Missing parameter comment
 274 | ERROR   | [ ] Description for the @return value is missing
 276 | ERROR   | [x] Visibility must be declared on method "_choice"
 276 | ERROR   | [ ] Method name "ConfigPartialExportCommands::_choice" is not in lowerCamel format
 276 | ERROR   | [ ] Type hint "array" missing for $widths
 279 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 279 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 300 | ERROR   | [ ] The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
 313 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 317 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 336 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 343 | ERROR   | [ ] Missing short description in doc comment
 344 | ERROR   | [ ] Missing parameter comment
 344 | ERROR   | [ ] Missing parameter type
 345 | ERROR   | [ ] Missing parameter comment
 346 | ERROR   | [ ] Missing parameter comment
 347 | ERROR   | [ ] Missing parameter comment
 348 | ERROR   | [ ] Description for the @return value is missing
 350 | ERROR   | [x] Visibility must be declared on method "_print_table"
 350 | ERROR   | [ ] Method name "ConfigPartialExportCommands::_print_table" is not in lowerCamel format
 350 | ERROR   | [ ] Type hint "array" missing for $widths
 350 | ERROR   | [ ] Type hint "null" missing for $handle
 361 | ERROR   | [x] Visibility must be declared on method "_drush_format_table"
 361 | ERROR   | [ ] Method name "ConfigPartialExportCommands::_drush_format_table" is not in lowerCamel format
 361 | ERROR   | [x] Missing function doc comment
-----------------------------------------
PHPCBF CAN FIX THE 21 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/config_partial_export/src/Utility/CommandHelper.php
-----------------------------------------
FOUND 37 ERRORS AND 1 WARNING AFFECTING 25 LINES
-----------------------------------------
  15 | ERROR   | [x] There must be one blank line after the last USE statement; 2 found;
  23 | ERROR   | [ ] Missing short description in doc comment
  24 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  28 | ERROR   | [ ] Missing member variable doc comment
  30 | ERROR   | [ ] Missing member variable doc comment
  32 | ERROR   | [ ] Missing member variable doc comment
  34 | ERROR   | [ ] Missing member variable doc comment
  36 | ERROR   | [ ] Missing member variable doc comment
  38 | ERROR   | [ ] Missing member variable doc comment
  40 | ERROR   | [ ] Missing member variable doc comment
  42 | ERROR   | [ ] Missing member variable doc comment
  44 | ERROR   | [ ] Missing short description in doc comment
  50 | ERROR   | [ ] Missing short description in doc comment
  50 | ERROR   | [ ] Parameter $moduleHandler is not described in comment
  50 | ERROR   | [ ] Parameter $eventDispatcher is not described in comment
  50 | ERROR   | [ ] Parameter $lock is not described in comment
  50 | ERROR   | [ ] Parameter $configTyped is not described in comment
  50 | ERROR   | [ ] Parameter $moduleInstaller is not described in comment
  50 | ERROR   | [ ] Parameter $themeHandler is not described in comment
  50 | ERROR   | [ ] Parameter $stringTranslation is not described in comment
  51 | ERROR   | [ ] Missing parameter comment
  51 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  52 | ERROR   | [ ] Missing parameter comment
  52 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  53 | ERROR   | [ ] Missing parameter comment
  53 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  55 | ERROR   | [x] Expected 1 blank line before function; 2 found
  56 | ERROR   | [x] Opening brace should be on the same line as the declaration
  70 | ERROR   | [ ] Parameter $destination_dir is not described in comment
  83 | ERROR   | [x] Visibility must be declared on method "_config_partial_export_write_config"
  83 | ERROR   | [ ] Method name "CommandHelper::_config_partial_export_write_config" is not in lowerCamel format
 110 | ERROR   | [x] Visibility must be declared on method "_config_partial_export_get_wildcard_keys"
 110 | ERROR   | [ ] Method name "CommandHelper::_config_partial_export_get_wildcard_keys" is not in lowerCamel format
 131 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 148 | ERROR   | [x] Visibility must be declared on method "_config_partial_export_get_changes"
 148 | ERROR   | [ ] Method name "CommandHelper::_config_partial_export_get_changes" is not in lowerCamel format
 169 | ERROR   | [x] Expected 1 blank line after function; 0 found
 170 | ERROR   | [x] The closing brace for the class must have an empty line before it
-----------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------

Time: 216ms; Memory: 12MB

Steps to reproduce

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

Proposed resolution

Fix the PHPCS issues.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇩🇪Germany Grevil

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.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Grevil
  • First commit to issue fork.
  • Status changed to Needs work over 1 year ago
  • Assigned to sidharth_soman
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sidharth_soman Bangalore

    I have solved the fixable coding standard errors. However, there are many remaining which are to do with variable/method documentation comments. I think these would probably best be done by the maintainers. I'm moving this to 'Needs Review' for now but it's fine if someone else wants to work on the remaining errors too.

    Please review this patch.

  • 🇩🇪Germany Grevil

    @_pratik_ already committed changes to this issue's fork, please provide your changes on top of his changes, @sidharth_soman!

  • 🇮🇳India saket-001

    Applying the patch #7 not remove all the standrad error till i m moving status to needs work.

  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • 🇮🇳India Rashmisoni Bangalore

    Patch #7 applied. #9 image not able to find complete pending issue list so attaching pending issues.

    FILE: ~/projects/drupal-d10/modules/contrib/config_partial_export/src/Commands/ConfigPartialExportCommands.php
    --------------------------------------
    FOUND 51 ERRORS AND 2 WARNINGS AFFECTING 49 LINES
    -----------------------------------------
      23 | ERROR   | Missing short description in doc comment
      28 | ERROR   | Missing member variable doc comment
      30 | ERROR   | Missing member variable doc comment
      32 | ERROR   | Missing member variable doc comment
      34 | ERROR   | Missing member variable doc comment
      36 | ERROR   | Missing member variable doc comment
      38 | ERROR   | Missing member variable doc comment
      40 | ERROR   | Missing member variable doc comment
      42 | ERROR   | Missing member variable doc comment
      44 | ERROR   | Missing short description in doc comment
      49 | ERROR   | Missing short description in doc comment
      50 | ERROR   | Missing parameter comment
      51 | ERROR   | Missing parameter comment
      52 | ERROR   | Missing parameter comment
      53 | ERROR   | Missing parameter comment
      54 | ERROR   | Missing parameter comment
      55 | ERROR   | Missing parameter comment
      56 | ERROR   | Missing parameter comment
      57 | ERROR   | Missing parameter comment
      58 | ERROR   | Missing parameter comment
      59 | ERROR   | Missing parameter comment
      78 | ERROR   | Missing parameter type
      80 | ERROR   | Missing parameter type
      81 | WARNING | Line exceeds 80 characters; contains 112 characters
      83 | WARNING | Line exceeds 80 characters; contains 88 characters
     163 | ERROR   | Parameter $destination_dir is not described in comment
     176 | ERROR   | Public method name "ConfigPartialExportCommands::_config_partial_export_write_config" is not in lowerCamel format
     203 | ERROR   | Public method name "ConfigPartialExportCommands::_config_partial_export_get_wildcard_keys" is not in lowerCamel format
     242 | ERROR   | Public method name "ConfigPartialExportCommands::_config_partial_export_get_changes" is not in lowerCamel format
     265 | ERROR   | Missing short description in doc comment
     266 | ERROR   | Missing parameter comment
     267 | ERROR   | Description for the @return value is missing
     269 | ERROR   | Public method name "ConfigPartialExportCommands::_user_abort" is not in lowerCamel format
     269 | ERROR   | Type hint "null" missing for $msg
     275 | ERROR   | Missing short description in doc comment
     276 | ERROR   | Missing parameter comment
     276 | ERROR   | Missing parameter type
     277 | ERROR   | Missing parameter comment
     278 | ERROR   | Missing parameter comment
     279 | ERROR   | Missing parameter comment
     280 | ERROR   | Description for the @return value is missing
     282 | ERROR   | Public method name "ConfigPartialExportCommands::_choice" is not in lowerCamel format
     354 | ERROR   | Missing short description in doc comment
     355 | ERROR   | Missing parameter comment
     355 | ERROR   | Missing parameter type
     356 | ERROR   | Missing parameter comment
     357 | ERROR   | Missing parameter comment
     358 | ERROR   | Missing parameter comment
     359 | ERROR   | Description for the @return value is missing
     361 | ERROR   | Public method name "ConfigPartialExportCommands::_print_table" is not in lowerCamel format
     361 | ERROR   | Type hint "null" missing for $handle
     372 | ERROR   | Doc comment is empty
     375 | ERROR   | Public method name "ConfigPartialExportCommands::_drush_format_table" is not in lowerCamel format
    ---------------------------------------
    
    
    FILE: ~/projects/drupal-d10/modules/contrib/config_partial_export/src/Utility/CommandHelper.php
    -------------------------------------------------
    FOUND 25 ERRORS AFFECTING 25 LINES
    -----------------------------------------------
      22 | ERROR | Missing short description in doc comment
      27 | ERROR | Missing member variable doc comment
      29 | ERROR | Missing member variable doc comment
      31 | ERROR | Missing member variable doc comment
      33 | ERROR | Missing member variable doc comment
      35 | ERROR | Missing member variable doc comment
      37 | ERROR | Missing member variable doc comment
      39 | ERROR | Missing member variable doc comment
      41 | ERROR | Missing member variable doc comment
      43 | ERROR | Missing short description in doc comment
      48 | ERROR | Missing short description in doc comment
      49 | ERROR | Missing parameter comment
      50 | ERROR | Missing parameter comment
      51 | ERROR | Missing parameter comment
      52 | ERROR | Missing parameter comment
      53 | ERROR | Missing parameter comment
      54 | ERROR | Missing parameter comment
      55 | ERROR | Missing parameter comment
      56 | ERROR | Missing parameter comment
      57 | ERROR | Missing parameter comment
      58 | ERROR | Missing parameter comment
      74 | ERROR | Parameter $destination_dir is not described in comment
      87 | ERROR | Public method name "CommandHelper::_config_partial_export_write_config" is not in lowerCamel format
     114 | ERROR | Public method name "CommandHelper::_config_partial_export_get_wildcard_keys" is not in lowerCamel format
     153 | ERROR | Public method name "CommandHelper::_config_partial_export_get_changes" is not in lowerCamel format
    ------------------------------------------------------
    Time: 196ms; Memory: 12MB
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    See comment #8 🐛 Fix the issues reported by phpcs Needs work : The patch needs to be re-rolled.

  • First commit to issue fork.
  • First commit to issue fork.
  • Assigned to Shruthi rao
  • Issue was unassigned.
  • Assigned to nitin_lama
  • 🇮🇳India nitin_lama

    Remaining issues:

    FILE: /home/system/Documents/contribution/config_partial_export-3336398/src/Utility/CommandHelper.php
    --------------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
    --------------------------------------------------------------------------------------------------------------------------
     130 | ERROR   | Parameter $destination_dir is not described in comment
     143 | ERROR   | Public method name "CommandHelper::_config_partial_export_write_config" is not in lowerCamel format
     170 | ERROR   | Public method name "CommandHelper::_config_partial_export_get_wildcard_keys" is not in lowerCamel format
     191 | WARNING | Line exceeds 80 characters; contains 81 characters
     208 | ERROR   | Public method name "CommandHelper::_config_partial_export_get_changes" is not in lowerCamel format
    --------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/system/Documents/contribution/config_partial_export-3336398/src/Commands/ConfigPartialExportCommands.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 10 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------
     156 | ERROR   | The array declaration extends to column 142 (the limit is 80). The array content should be split up over multiple lines
     233 | ERROR   | Public method name "ConfigPartialExportCommands::_config_partial_export_write_config" is not in lowerCamel format
     260 | ERROR   | Public method name "ConfigPartialExportCommands::_config_partial_export_get_wildcard_keys" is not in lowerCamel format
     281 | WARNING | Line exceeds 80 characters; contains 81 characters
     298 | ERROR   | Public method name "ConfigPartialExportCommands::_config_partial_export_get_changes" is not in lowerCamel format
     330 | ERROR   | Public method name "ConfigPartialExportCommands::_user_abort" is not in lowerCamel format
     351 | ERROR   | Public method name "ConfigPartialExportCommands::_choice" is not in lowerCamel format
     354 | WARNING | Line exceeds 80 characters; contains 83 characters
     437 | ERROR   | Public method name "ConfigPartialExportCommands::_print_table" is not in lowerCamel format
     451 | ERROR   | Public method name "ConfigPartialExportCommands::_drush_format_table" is not in lowerCamel format
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 107ms; Memory: 10MB
    
  • Issue was unassigned.
  • Assigned to Prem Suthar
  • Status changed to Needs review 4 months ago
  • 🇮🇳India Prem Suthar gujrat

    Fix the all reaming issues Please review and merge This Changes.

Production build 0.69.0 2024