Fix the issues reported by phpcs

Created on 16 February 2023, over 1 year ago
Updated 17 February 2023, over 1 year ago

Problem/Motivation


FILE: ...ocs\abc\drupal\modules\localized_config\localized_config.api.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...docs\abc\drupal\modules\localized_config\localized_config.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...mple\src\Plugin\LocalizedConfig\LocalizedConfigExamplePlugin.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...al\modules\localized_config\src\Access\LocalizedConfigAccess.php
----------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 20 | ERROR | [ ] Parameter $localizedConfigHelper is not described
    |       |     in comment
 20 | ERROR | [ ] Parameter $languageHelper is not described in
    |       |     comment
 23 | ERROR | [ ] Doc comment for parameter $localized_config_helper
    |       |     does not match actual variable name $languageHelper
 25 | ERROR | [ ] Doc comment for parameter $language_helper does not
    |       |     match actual variable name $languageHelper
 54 | ERROR | [x] Namespaced classes/interfaces/traits should be
    |       |     referenced with use statements
 54 | ERROR | [x] Namespaced classes/interfaces/traits should be
    |       |     referenced with use statements
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...\localized_config\src\Command\GenerateLocalizedConfigCommand.php
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n"
     |         |     but found "\r\n"
 382 | WARNING | [ ] \Drupal calls should be avoided in classes, use
     |         |     dependency injection instead
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ed_config\src\Config\LocalizedConfigFactoryOverrideDecorator.php
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 33 | ERROR | [ ] Parameter $innerService is not described in comment
 36 | ERROR | [ ] Doc comment for parameter $inner_service does not
    |       |     match actual variable name $default_language
 48 | ERROR | [x] Expected 1 space between type hint and argument
    |       |     "$innerService"; 0 found
 49 | ERROR | [x] Multi-line function declarations must define one
    |       |     parameter per line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...drupal\modules\localized_config\src\Form\LocalizedConfigForm.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n"
     |       |     but found "\r\n"
 570 | ERROR | [x] Namespaced classes/interfaces/traits should be
     |       |     referenced with use statements
 642 | ERROR | [x] Namespaced classes/interfaces/traits should be
     |       |     referenced with use statements
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...al\modules\localized_config\src\Form\LocalizedConfigSettings.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...alized_config\src\Generator\GenerateLocalizedConfigGenerator.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...bc\drupal\modules\localized_config\src\LocalizedConfigHelper.php
----------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 10 LINES
----------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n"
     |       |     but found "\r\n"
  25 | ERROR | [ ] Parameter $config is not described in comment
  25 | ERROR | [ ] Parameter $languageManager is not described in
     |       |     comment
  25 | ERROR | [ ] Parameter $pluginManager is not described in
     |       |     comment
  25 | ERROR | [ ] Parameter $cacheTagsInvalidator is not described
     |       |     in comment
  25 | ERROR | [ ] Parameter $languageHelper is not described in
     |       |     comment
  28 | ERROR | [ ] Doc comment for parameter $config_factory does not
     |       |     match actual variable name $languageHelper
  30 | ERROR | [ ] Doc comment for parameter $language_manager does
     |       |     not match actual variable name $languageHelper
  32 | ERROR | [ ] Doc comment for parameter
     |       |     $localized_config_plugin_manager does not match
     |       |     actual variable name $languageHelper
  34 | ERROR | [ ] Doc comment for parameter $cache_tags_invalidator
     |       |     does not match actual variable name
     |       |     $languageHelper
  36 | ERROR | [ ] Doc comment for parameter $language_helper does
     |       |     not match actual variable name $languageHelper
 219 | ERROR | [x] Expected
     |       |     "\Drupal\Core\Language\LanguageInterface|false"
     |       |     but found
     |       |     "\Drupal\Core\Language\LanguageInterface|FALSE"
     |       |     for function return type
 222 | ERROR | [x] Namespaced classes/interfaces/traits should be
     |       |     referenced with use statements
 258 | ERROR | [x] Namespaced classes/interfaces/traits should be
     |       |     referenced with use statements
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...l\modules\localized_config\src\LocalizedConfigLanguageHelper.php
----------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 11 LINES
----------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n"
     |       |     but found "\r\n"
  25 | ERROR | [ ] Parameter $configFactory is not described in
     |       |     comment
  25 | ERROR | [ ] Parameter $languageManager is not described in
     |       |     comment
  25 | ERROR | [ ] Parameter $currentUser is not described in comment
  25 | ERROR | [ ] Parameter $moduleHandler is not described in
     |       |     comment
  28 | ERROR | [ ] Doc comment for parameter $config_factory does not
     |       |     match actual variable name $moduleHandler
  30 | ERROR | [ ] Doc comment for parameter $language_manager does
     |       |     not match actual variable name $moduleHandler
  32 | ERROR | [ ] Doc comment for parameter $current_user does not
     |       |     match actual variable name $moduleHandler
  34 | ERROR | [ ] Doc comment for parameter $module_handler does not
     |       |     match actual variable name $moduleHandler
  79 | ERROR | [ ] Description for the @return value is missing
  83 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  88 | ERROR | [x] Missing function doc comment
 110 | ERROR | [x] Whitespace found at end of line
 183 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...upal\modules\localized_config\src\LocalizedConfigPermissions.php
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 16 | ERROR | [ ] Parameter $pluginManager is not described in
    |       |     comment
 16 | ERROR | [ ] Parameter $localizedConfigHelper is not described
    |       |     in comment
 19 | ERROR | [ ] Doc comment for parameter $plugin_manager does not
    |       |     match actual variable name $localizedConfigHelper
 21 | ERROR | [ ] Doc comment for parameter $localized_config_helper
    |       |     does not match actual variable name
    |       |     $localizedConfigHelper
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...rupal\modules\localized_config\src\LocalizedConfigPluginBase.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 16 | ERROR | [ ] Parameter $localizedConfigHelper is not described
    |       |     in comment
 25 | ERROR | [ ] Doc comment for parameter $localized_config_helper
    |       |     does not match actual variable name
    |       |     $localizedConfigHelper
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...\modules\localized_config\src\LocalizedConfigPluginInterface.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...al\modules\localized_config\src\LocalizedConfigPluginManager.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...al\modules\localized_config\src\LocalizedConfigTwigFunctions.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...alized_config\src\Plugin\Menu\LocalizedConfigDynamicMenuLink.php
----------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 20 | ERROR | [ ] Parameter $localizedConfigHelper is not described
    |       |     in comment
 20 | ERROR | [ ] Parameter $currentUser is not described in comment
 20 | ERROR | [ ] Parameter $languageManager is not described in
    |       |     comment
 20 | ERROR | [ ] Parameter $languageHelper is not described in
    |       |     comment
 29 | ERROR | [ ] Doc comment for parameter $localized_config_helper
    |       |     does not match actual variable name $languageHelper
 31 | ERROR | [ ] Doc comment for parameter $current_user does not
    |       |     match actual variable name $languageHelper
 33 | ERROR | [ ] Doc comment for parameter $language_manager does
    |       |     not match actual variable name $languageHelper
 35 | ERROR | [ ] Doc comment for parameter $language_helper does not
    |       |     match actual variable name $languageHelper
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Steps to reproduce

Run the following command :
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /10.1.x/drupal/modules/contrib/localized_config

Proposed resolution

Fix all the PHP coding standard issues.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India Charchil Khandelwal

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

Comments & Activities

Production build 0.71.5 2024