Fix the issues reported by phpcs

Created on 8 December 2022, almost 2 years ago
Updated 29 June 2024, 5 months ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/key/drush/key_delete.drush.inc
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
20 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/drush/key_list.drush.inc
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
16 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/drush/key_value_get.drush.inc
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
11 | WARNING | [x] 'TODO: Only return the value (without the index), so the label can be' should match the format '@todo Fix problem X here.'
21 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Commands/KeyCommands.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
17 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
194 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
234 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
237 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
344 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Controller/KeyConfigOverrideListBuilder.php
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
84 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Controller/KeyListBuilder.php
-------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------
78 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
98 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
157 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Entity/Key.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------
341 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
363 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Entity/KeyConfigOverride.php
-----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
142 | WARNING | [x] 'TODO: Get the key entity.' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Form/KeyAddForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Form/KeyConfigOverrideAddForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
18 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
300 | ERROR | The array declaration extends to column 111 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Form/KeyEditForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
29 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Form/KeyFormBase.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------
86 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
355 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
358 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
382 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
385 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
412 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
415 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/KeyConfigOverrideInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/KeyConfigOverrides.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------
54 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
55 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
73 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
144 | WARNING | Unused variable $id.
----------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Plugin/KeyProvider/ConfigKeyProvider.php
---------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------
48 | ERROR | [x] Use null coalesce operator instead of ternary operator.
72 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/modules/key_test/src/Plugin/KeyProvider/State.php
----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------
13 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/src/Functional/KeyInputTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/src/Functional/KeyOverrideAdminTest.php
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
16 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/src/Functional/KeyRepositoryServiceTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
64 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/src/Unit/Entity/KeyEntityTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------
44 | ERROR | Class property $key_type_settings should use lowerCamel naming without underscores
52 | ERROR | Class property $key_provider_settings should use lowerCamel naming without underscores
60 | ERROR | Class property $key_input_settings should use lowerCamel naming without underscores
111 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

Time: 977ms; Memory: 14MB

Steps to reproduce

Run following command

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

Proposed resolution

Above error/warnings need to be fixed

๐Ÿ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

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.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    Charchil Khandelwal โ†’ made their first commit to this issueโ€™s fork.

  • @charchil-khandelwal opened merge request.
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    Created MR.

    Please review.

  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States rlhawk Seattle, Washington, United States

    The merge request appears to be the same as the originally submitted patch and does not address the issue in jcnventura's
    comment, the breaking of backward-compatibility in the KeyConfigOverrides constructor. Also, coding standard violations are not bugs.

  • First commit to issue fork.
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฏ๐Ÿ‡ตJapan ptmkenny

    Submitted a new MR to branch 3325937-drupal-coding-standards that applies the changes in patch #2 without DI of entityTypeManager as requested in #3.

    Did not edit the MR in branch 8.x-1.x as it is confusing to have a feature branch name that is the same as the module's dev branch.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
         arguments: ['key_input', '@container.namespaces', '@cache.discovery', '@module_handler']
       key.config_override:
         class: \Drupal\key\KeyConfigOverrides
    -    arguments: ['@config.factory', '@cache.data']
    +    arguments: ['@config.factory', '@cache.data', '@entity_type.manager']

    The entity type manager is yet added to the constructor since arguments is the list of the arguments passed to a service constructor. That is what jcnventura said not to do, in comment #3.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    zkhan.aamir โ†’ made their first commit to this issueโ€™s fork.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 11 months ago
    8 pass
  • Status changed to Needs review 11 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    All phpcs issues are fixed on MR 10. Please review.

  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • First commit to issue fork.
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 10 months ago
    8 pass
  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    apaderno โ†’ changed the visibility of the branch 8.x-1.x to hidden.

  • Status changed to RTBC 6 months ago
  • ๐Ÿ‡ต๐Ÿ‡นPortugal jcnventura

    Checked all the changes in the MR. Only phpcs-style changes are being made, and the changes are good, The use of the null coalescing operator means that after this change the module is only for PHP 7.0+, but PHP 5.6 support has been dropped a long time ago by everyone (PHP, Drupal and all decent hosters).

    Please add the GitLab CI changes, then merge this MR. We can then use the GitLab pipelines to see if there's anything still left. Maybe add credit on this issue to the ones that contributed to ๐Ÿ“Œ Drupal Coding Standards Issues | phpcs Needs review .

  • Pipeline finished with Success
    5 months ago
    Total: 218s
    #211383
  • ๐Ÿ‡ฏ๐Ÿ‡ตJapan ptmkenny

    Adding the GitLab CI template identified many more issues:

    FILE: ...937/web/modules/custom/key-3325937/tests/src/Unit/Entity/KeyEntityTest.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\key\Plugin\KeyInput\NoneKeyInput.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...937/web/modules/custom/key-3325937/tests/src/Kernel/KeyDeprecationTest.php
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     17 | ERROR | [x] @inheritdoc found. Did you mean {@inheritdoc}?
        |       |     (Drupal.Commenting.DocComment.InheritDocWithoutBraces)
     18 | ERROR | [ ] Missing @var tag in member variable comment
        |       |     (Drupal.Commenting.VariableComment.MissingVar)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...dules/custom/key-3325937/tests/src/Functional/KeyRepositoryServiceTest.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Key\KeyInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...25937/web/modules/custom/key-3325937/tests/src/Functional/KeyAdminTest.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Core\Url.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...ey-3325937/tests/modules/key_test/src/Plugin/KeyType/MultiValueKeyType.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     43 | ERROR | [x] Multi-line function declarations must have a trailing comma
        |       |     after the last parameter
        |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...custom/key-3325937/tests/modules/key_test/src/Plugin/KeyProvider/State.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     43 | ERROR | [x] Multi-line function declarations must have a trailing comma
        |       |     after the last parameter
        |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...937/tests/modules/key_test/src/Plugin/KeyProvider/DeprecatedDefinition.php
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
      5 | ERROR | [x] There must be one blank line after the last USE statement; 2
        |       |     found; (PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse)
     21 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
        |       |     with use statements
        |       |     (Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...-3325937/tests/modules/key_test/src/Plugin/KeyInput/MutliValueKeyInput.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     33 | ERROR | [x] Multi-line function declarations must have a trailing comma
        |       |     after the last parameter
        |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...lds/issue/key-3325937/web/modules/custom/key-3325937/src/KeyRepository.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Component\Plugin\PluginManagerInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...y-3325937/web/modules/custom/key-3325937/src/Plugin/KeyPluginInterface.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is
       |       |     Drupal\Component\Plugin\PluginInspectionInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...ue/key-3325937/web/modules/custom/key-3325937/src/Plugin/KeyPluginBase.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Component\Utility\NestedArray.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...37/web/modules/custom/key-3325937/src/Plugin/KeyType/EncryptionKeyType.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\key\Plugin\KeyPluginFormInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: .../web/modules/custom/key-3325937/src/Plugin/KeyProvider/FileKeyProvider.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\key\Plugin\KeyPluginFormInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...7/web/modules/custom/key-3325937/src/Plugin/KeyProvider/EnvKeyProvider.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\key\Plugin\KeyPluginFormInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...eb/modules/custom/key-3325937/src/Plugin/KeyProvider/ConfigKeyProvider.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\key\Plugin\KeyPluginFormInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: .../issue/key-3325937/web/modules/custom/key-3325937/src/Form/KeyFormBase.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is
       |       |     Drupal\Core\Config\Entity\ConfigEntityStorageInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...y-3325937/web/modules/custom/key-3325937/src/Controller/KeyListBuilder.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Core\Entity\EntityInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...modules/custom/key-3325937/src/Controller/KeyConfigOverrideListBuilder.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     9 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Core\Entity\EntityInterface.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    FILE: ...ue/key-3325937/web/modules/custom/key-3325937/src/Commands/KeyCommands.php
    --------------------------------------------------------------------------------
    FOUND 8 ERRORS AFFECTING 6 LINES
    --------------------------------------------------------------------------------
      55 | ERROR | [x] Multi-line function declarations must have a trailing comma
         |       |     after the last parameter
         |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
     103 | ERROR | [x] Multi-line function declarations must have a trailing comma
         |       |     after the last parameter
         |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
     234 | ERROR | [x] The first parameter of a multi-line function declaration
         |       |     must be on the line after the opening bracket
         |       |     (Drupal.Functions.MultiLineFunctionDeclaration.FirstParamSpacing)
     237 | ERROR | [x] Multi-line function declarations must have a trailing comma
         |       |     after the last parameter
         |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
     237 | ERROR | [x] The closing parenthesis of a multi-line function declaration
         |       |     must be on a new line
         |       |     (Drupal.Functions.MultiLineFunctionDeclaration.CloseBracketLine)
     311 | ERROR | [x] The first parameter of a multi-line function declaration
         |       |     must be on the line after the opening bracket
         |       |     (Drupal.Functions.MultiLineFunctionDeclaration.FirstParamSpacing)
     314 | ERROR | [x] Multi-line function declarations must have a trailing comma
         |       |     after the last parameter
         |       |     (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
     314 | ERROR | [x] The closing parenthesis of a multi-line function declaration
         |       |     must be on a new line
         |       |     (Drupal.Functions.MultiLineFunctionDeclaration.CloseBracketLine)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    Time: 604ms; Memory: 8MB
    PHP CODE SNIFFER REPORT SUMMARY
    --------------------------------------------------------------------------------
    FILE                                                            ERRORS  WARNINGS
    --------------------------------------------------------------------------------
    ...325937/web/modules/custom/key-3325937/src/KeyRepository.php  1       0
    ...web/modules/custom/key-3325937/src/Commands/KeyCommands.php  8       0
    ...key-3325937/src/Controller/KeyConfigOverrideListBuilder.php  1       0
    ...odules/custom/key-3325937/src/Controller/KeyListBuilder.php  1       0
    ...937/web/modules/custom/key-3325937/src/Form/KeyFormBase.php  1       0
    ...web/modules/custom/key-3325937/src/Plugin/KeyPluginBase.php  1       0
    ...odules/custom/key-3325937/src/Plugin/KeyPluginInterface.php  1       0
    ...om/key-3325937/src/Plugin/KeyProvider/ConfigKeyProvider.php  1       0
    ...ustom/key-3325937/src/Plugin/KeyProvider/EnvKeyProvider.php  1       0
    ...stom/key-3325937/src/Plugin/KeyProvider/FileKeyProvider.php  1       0
    ...custom/key-3325937/src/Plugin/KeyType/EncryptionKeyType.php  1       0
    ...modules/key_test/src/Plugin/KeyInput/MutliValueKeyInput.php  1       0
    ...es/key_test/src/Plugin/KeyProvider/DeprecatedDefinition.php  2       0
    ...937/tests/modules/key_test/src/Plugin/KeyProvider/State.php  1       0
    ...s/modules/key_test/src/Plugin/KeyType/MultiValueKeyType.php  1       0
    ...es/custom/key-3325937/tests/src/Functional/KeyAdminTest.php  1       0
    ...y-3325937/tests/src/Functional/KeyRepositoryServiceTest.php  1       0
    .../custom/key-3325937/tests/src/Kernel/KeyDeprecationTest.php  2       0
    .../custom/key-3325937/tests/src/Unit/Entity/KeyEntityTest.php  1       0
    --------------------------------------------------------------------------------
    A TOTAL OF 28 ERRORS AND 0 WARNINGS WERE FOUND IN 67 FILES
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX 27 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
    --------------------------------------------------------------------------------
        SOURCE                                                                 COUNT
    --------------------------------------------------------------------------------
    [x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl  13
    [x] Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma     7
    [x] Drupal.Functions.MultiLineFunctionDeclaration.CloseBracketLine         2
    [x] Drupal.Functions.MultiLineFunctionDeclaration.FirstParamSpacing        2
    [x] Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing             1
    [x] Drupal.Commenting.DocComment.InheritDocWithoutBraces                   1
    [ ] Drupal.Commenting.VariableComment.MissingVar                           1
    [x] PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse                       1
    --------------------------------------------------------------------------------
    A TOTAL OF 28 SNIFF VIOLATIONS WERE FOUND IN 8 SOURCES
    --------------------------------------------------------------------------------
    

    I think most of these are the result of coding standard changes made since this issue was opened.

    I have applied the automated fixes to the MR.

  • Pipeline finished with Failed
    5 months ago
    #211389
  • Status changed to Needs work 5 months ago
  • ๐Ÿ‡ฏ๐Ÿ‡ตJapan ptmkenny

    GitLab CI is passing now but this is still not ready. First, there are incorrect coding standards changes in the MR: Class comments need to describe what the class does, not just add "The".

    More importantly, @apaderno's comment

    This is not a backward-compatible change.

    regarding DI has not been addressed.

    Actually, I think the DI should be removed from this MR, as GitLab CI treats DI as a phpstan issue, not a coding standards issue. But in any case, this cannot be committed as is.

Production build 0.71.5 2024