Fix the issues reported by phpcs

Created on 4 July 2023, almost 2 years ago
Updated 20 May 2024, 11 months ago

Problem/Motivation

Used Command:-
./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/advance_importer

Error found by PHPCS

FILE: /home/system/Documents/contribution/advance_importer/src/Plugin/Processor/ProcessorInterface.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------
 28 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 28 | ERROR | Variable "HEADER_KEY_VALUE_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 28 | ERROR | Variable "MULTI_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 33 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/src/Plugin/Processor/JSON.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------------------------------------------
  76 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
  76 | ERROR | Variable "HEADER_KEY_VALUE_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
  76 | ERROR | Variable "MULTI_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
  82 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
  86 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 113 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 115 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/src/Plugin/Processor/CSV.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------
  91 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
  91 | ERROR | Variable "HEADER_KEY_VALUE_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
  91 | ERROR | Variable "MULTI_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
  93 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 111 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 113 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/src/Plugin/Processor/XML.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------------------------------------------
 111 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 111 | ERROR | Variable "HEADER_KEY_VALUE_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 111 | ERROR | Variable "MULTI_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 113 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 119 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 127 | ERROR | Variable "HEADER_KEY_VALUE_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 151 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 153 | ERROR | Variable "FILE_EXPORT" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/src/Operations/BaseOperation.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------------------
 17 | ERROR | Class property $HEADER_KEY_VALUE_DELIMITER should use lowerCamel naming without underscores
 24 | ERROR | Class property $MULTI_DELIMITER should use lowerCamel naming without underscores
 70 | ERROR | Variable "HEADER_KEY_VALUE_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 70 | ERROR | Variable "MULTI_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 71 | ERROR | Variable "HEADER_KEY_VALUE_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 72 | ERROR | Variable "MULTI_DELIMITER" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
-------------------------------------------------------------------------------------------------------------------------------------

Time: 138ms; Memory: 10MB

FILE: /home/system/Documents/contribution/advance_importer/interdiff-4-0.txt
----------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------
 108 | WARNING | Unused variable $entity_type.
 129 | WARNING | Unused variable $list_fields.
----------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/src/Plugin/Processor/JSON.php
----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------
 85 | WARNING | Unused variable $header_entity.
----------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/src/Plugin/Processor/CSV.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------
 70 | WARNING | Unused variable $csv.
---------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/src/Plugin/Processor/XML.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------
 117 | WARNING | Unused variable $header_entity.
---------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/src/Operations/BaseOperation.php
-------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------
 208 | WARNING | Unused variable $target_type.
 259 | WARNING | Unused variable $entity_type.
-------------------------------------------------------------------------------------------


FILE: /home/system/Documents/contribution/advance_importer/advance_importer.module
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 8 | WARNING | There must be no blank line following an inline comment
----------------------------------------------------------------------------------

Time: 116ms; Memory: 8MB
📌 Task
Status

Needs work

Version

1.3

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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

Production build 0.71.5 2024