Fix the issues reported by phpcs

Created on 9 May 2023, about 1 year ago
Updated 24 May 2023, about 1 year ago

Problem/Motivation

Module's code contains several Drupal Coding Standards issues. This task is created to fix them.

Steps to reproduce

Run the command:

phpcs --standard=Drupal,DrupalPractice <project_root>/web/modules/contrib/map_object_field/

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.


FILE: modules\contrib\map_object_field\assets\css\map-object-field-default-formatter.css    
---------------------------------------------------------------------------------------------------------------    
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: modules\contrib\map_object_field\assets\css\map-object-field-default-widget-config.css
-------------------------------------------------------------------------------------------------------------------
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: modules\contrib\map_object_field\assets\css\map-object-field-default-widget.css
------------------------------------------------------------------------------------------------------------
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: modules\contrib\map_object_field\assets\js\map-object-field-default-formatter.js
-------------------------------------------------------------------------------------------------------------
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: modules\contrib\map_object_field\assets\js\map-object-field-default-widget-config.js
-----------------------------------------------------------------------------------------------------------------
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: modules\contrib\map_object_field\assets\js\map-object-field-default-widget.js
----------------------------------------------------------------------------------------------------------
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: modules\contrib\map_object_field\src\Plugin\Field\FieldFormatter\MapObjectFieldDefaultFormatter.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
 28 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 52 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------------------------------


FILE: modules\contrib\map_object_field\src\Plugin\Field\FieldWidget\MapObjectFieldDefaultWidget.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  83 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 127 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 201 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 317 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: modules\contrib\map_object_field\src\Plugin\views\style\SingleMap.php
--------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------
 138 | WARNING | Unused variable $element.
 142 | WARNING | Unused variable $index.
--------------------------------------------------------------------------------------------------

Time: 7.15 secs; Memory: 14MB


📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇦Ukraine ysamoylenko

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

Comments & Activities

Production build 0.69.0 2024