Drupal coding standards errors/warnings

Created on 6 May 2020, over 4 years ago
Updated 10 July 2024, 5 months ago
$ ./vendor/bin/drupal-check -a docroot/modules/contrib/encryption
 5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -----------------------------------------------------------------------------------
  Line   src/EncryptionTrait.php (in context of class Drupal\encryption\EncryptionService)
 ------ -----------------------------------------------------------------------------------
  43     Method Drupal\encryption\EncryptionService::encrypt() should return
         string|null but return statement is missing.
  75     Method Drupal\encryption\EncryptionService::decrypt() should return
         string|null but return statement is missing.
  101    Method Drupal\encryption\EncryptionService::getEncryptionKey() should
         return string|null but return statement is missing.
 ------ -----------------------------------------------------------------------------------

 [ERROR] Found 3 errors
 [ExecStack] '/vendor/bin/phpcs'
 ..EWWE 6 / 6 (100%)



 FILE: /docroot/modules/contrib/encryption/tests/src/Kernel/EncryptionServiceTest.php
 ------------------------------------------------------------------------------------------------------------------------------
 FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
 ------------------------------------------------------------------------------------------------------------------------------
   9 | ERROR   | [ ] Missing short description in doc comment
  47 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  57 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
  68 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 ------------------------------------------------------------------------------------------------------------------------------
 PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
 ------------------------------------------------------------------------------------------------------------------------------


 FILE: /docroot/modules/contrib/encryption/src/EncryptionServiceInterface.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: /docroot/modules/contrib/encryption/src/EncryptionService.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: /docroot/modules/contrib/encryption/src/EncryptionTrait.php
 -------------------------------------------------------------------------------------------------------------------------------------------
 FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
 -------------------------------------------------------------------------------------------------------------------------------------------
   5 | WARNING | [x] Unused use statement
  77 | ERROR   | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
 -------------------------------------------------------------------------------------------------------------------------------------------
 PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
 -------------------------------------------------------------------------------------------------------------------------------------------
🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India suresh prabhu parkala Bangalore

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

Comments & Activities

Not all content is available!

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

  • 🇮🇳India riddhi.addweb

    Seems like the errors are not resolved properly, because after applying the patch the phpcs errors are still displayed. Attaching screenshots for the same.

    FILE: /var/www/html/web/drupal10/web/modules/contrib/encryption/tests/src/Kernel/EncryptionServiceTest.php
    -------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Site\Settings.
    -------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/drupal10/web/modules/contrib/encryption/encryption.install
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 3 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     36 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
     37 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
     56 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('encryption_reset_test_string') instead
     56 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('encryption_reset_test_string') instead
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/drupal10/web/modules/contrib/encryption/README.md
    -------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------
     85 | WARNING | Line exceeds 80 characters; contains 87 characters
    -------------------------------------------------------------------------
Production build 0.71.5 2024