Fix the issues reported by phpcs

Created on 2 January 2024, 11 months ago
Updated 19 January 2024, 10 months ago

Running

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

Shows the following errors:

FILE: J:\laragon\www\drupnew\web\modules\contrib\login_dialog_hotkey\config\install\login_dialog_hotkey.settings.yml                                                         
--------------------------------------------------------------------------------------------------------------------                                                         
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                                                               
--------------------------------------------------------------------------------------------------------------------                                                         
 7 | ERROR | [x] Expected 1 newline at end of file; 0 found                                                                                                                  
--------------------------------------------------------------------------------------------------------------------                                                         
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY                                                                                                                   
--------------------------------------------------------------------------------------------------------------------                                                         
                                                                                                                                                                             
                                                                                                                                                                             
FILE: J:\laragon\www\drupnew\web\modules\contrib\login_dialog_hotkey\css\admin_settings.css                                                                                  
-------------------------------------------------------------------------------------------                                                                                  
FOUND 3 ERRORS AFFECTING 3 LINES                                                                                                                                             
-------------------------------------------------------------------------------------------                                                                                  
 2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4                                                                                                       
 3 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4                                                                                                       
 4 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4                                                                                                       
-------------------------------------------------------------------------------------------                                                                                  
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY                                                                                                                   
-------------------------------------------------------------------------------------------                                                                                  
                                                                                                                                                                             
                                                                                                                                                                             
FILE: J:\laragon\www\drupnew\web\modules\contrib\login_dialog_hotkey\login_dialog_hotkey.info.yml                                                                            
-------------------------------------------------------------------------------------------------------------                                                                
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE                                                                                                                               
-------------------------------------------------------------------------------------------------------------                                                                
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically                                                                   
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically                                                                 
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically                                                                   
-------------------------------------------------------------------------------------------------------------                                                                
                                                                                                                                                                             
                                                                                                                                                                             
FILE: J:\laragon\www\drupnew\web\modules\contrib\login_dialog_hotkey\login_dialog_hotkey.module                                                                              
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                                                                                             
FOUND 17 ERRORS AND 2 WARNINGS AFFECTING 16 LINES                                                                                                                            
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                                                                                             
  1 | ERROR   | [x] Missing file doc comment                                                                                                                                 
  4 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.t
    |         |     xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."                                                                          
  4 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
  5 | ERROR   | [ ] Doc comment short description must end with a full stop                                                                                                  
  5 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph                                                      
 14 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.t
    |         |     xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."                                                                          
 15 | ERROR   | [ ] Doc comment short description must end with a full stop                                                                                                  
 15 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph                                                      
 18 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 20 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 22 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 26 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 28 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 30 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 32 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 34 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 36 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 38 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
 40 | ERROR   | [x] Whitespace found at end of line                                                                                                                          
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                                                                                             
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY                                                                                                                  
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                                                                                             
                                                                                                                                                                             
                                                                                                                                                                             
FILE: J:\laragon\www\drupnew\web\modules\contrib\login_dialog_hotkey\login_dialog_hotkey.routing.yml                                                                         
----------------------------------------------------------------------------------------------------                                                                         
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                                                               
----------------------------------------------------------------------------------------------------                                                                         
 7 | ERROR | [x] Expected 1 newline at end of file; 0 found                                                                                                                  
----------------------------------------------------------------------------------------------------                                                                         
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY                                                                                                                   
----------------------------------------------------------------------------------------------------                                                                         
                                                                                                                                                                             
                                                                                                                                                                             
FILE: J:\laragon\www\drupnew\web\modules\contrib\login_dialog_hotkey\README.md                                                                                               
------------------------------------------------------------------------------                                                                                               
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES                                                                                                                                
------------------------------------------------------------------------------                                                                                               
 3 | WARNING | [ ] Line exceeds 80 characters; contains 161 characters                                                                                                       
 6 | ERROR   | [x] Expected 1 newline at end of file; 0 found                                                                                                                
------------------------------------------------------------------------------                                                                                               
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY                                                                                                                   
------------------------------------------------------------------------------                                                                                               
                                                                                                                                                                             
                                                                                                                                                                             
FILE: J:\laragon\www\drupnew\web\modules\contrib\login_dialog_hotkey\src\Form\ModuleConfigurationForm.php                                                                    
---------------------------------------------------------------------------------------------------------                                                                    
FOUND 5 ERRORS AFFECTING 4 LINES                                                                                                                                             
---------------------------------------------------------------------------------------------------------                                                                    
  88 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"                                                                                  
  89 | ERROR | [x] Concat operator must be surrounded by a single space                                                                                                      
  89 | ERROR | [x] Concat operator must be surrounded by a single space                                                                                                      
  96 | ERROR | [x] Whitespace found at end of line                                                                                                                           
 156 | ERROR | [x] Expected 1 newline at end of file; 0 found                                                                                                                
---------------------------------------------------------------------------------------------------------                                                                    
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY                                                                                                                   
---------------------------------------------------------------------------------------------------------          

And running this phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml

shows following errors:

FILE: J:\laragon\www\drupnew\web\modules\contrib\login_dialog_hotkey\src\Form\ModuleConfigurationForm.php                                                                      
--------------------------------------------------------------------------------------------------------                                                                      
OUND 0 ERRORS AND 13 WARNINGS AFFECTING 13 LINES                                                                                                                              
--------------------------------------------------------------------------------------------------------                                                                      
 38 | WARNING | #description values usually have to run through t() for translation                                                                                           
 41 | WARNING | #options values usually have to run through t() for translation                                                                                               
 42 | WARNING | #options values usually have to run through t() for translation                                                                                               
 49 | WARNING | #description values usually have to run through t() for translation                                                                                           
 52 | WARNING | #options values usually have to run through t() for translation                                                                                               
 53 | WARNING | #options values usually have to run through t() for translation                                                                                               
 54 | WARNING | #options values usually have to run through t() for translation                                                                                               
 63 | WARNING | #description values usually have to run through t() for translation                                                                                           
 86 | WARNING | #description values usually have to run through t() for translation                                                                                           
100 | WARNING | #description values usually have to run through t() for translation                                                                                           
107 | WARNING | #description values usually have to run through t() for translation                                                                                           
114 | WARNING | #description values usually have to run through t() for translation                                                                                           
121 | WARNING | #description values usually have to run through t() for translation                                                                                           
--------------------------------------------------------------------------------------------------------                                                                                
📌 Task
Status

Fixed

Version

0.0

Component

Code

Created by

🇮🇳India kishan@lnwebworks

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

Comments & Activities

Production build 0.71.5 2024