Coding standard issues

Created on 9 September 2024, 2 months ago

Problem/Motivation

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

FILE: .../web/modules/custom/mailchimp/modules/mailchimp_lists/src/Form/MailchimpListsWebhookSettingsForm.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
131 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 7
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/mailchimp/modules/mailchimp_lists/mailchimp_lists.module
--------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------
260 | ERROR | Type hint "array" missing for $choices
380 | ERROR | Type hint "array" missing for $merge_fields
--------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/mailchimp/mailchimp.module
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
773 | ERROR | Type hint "array" missing for $options
813 | ERROR | Type hint "array" missing for $batch
1426 | WARNING | Only string literals should be passed to t() where possible
1445 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------

FILE: .../web/modules/custom/mailchimp/mailchimp.api.php
---------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------
85 | ERROR | Expected type hint "string"; found "array" for $choices
---------------------------------------------------------------------------------

Time: 1.2 secs; Memory: 18MB

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

General

Created by

🇵🇪Peru alyaj2a

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

Merge Requests

Comments & Activities

  • Issue created by @alyaj2a
  • Assigned to alyaj2a
  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • Merge request !90Coding stantard issues - #3473101 → (Open) created by alyaj2a
  • Pipeline finished with Success
    2 months ago
    Total: 177s
    #278369
  • Status changed to Needs work 2 months ago
  • Pipeline finished with Failed
    15 days ago
    #331779
  • Pipeline finished with Failed
    15 days ago
    #331794
  • 🇮🇳India akulsaxena

    Hi @xenophyle

    I worked on this and solved all the PHPCS issues. I also reverted back the removal of translation of form elements (t()) in the mailchimp.module file. Since i added back the t(), it is showing warning in phpcs pipeline but rest all the errors are solved.

    The phpunit tests are failing and are giving the error:
    Unable to install modules: module 'mailchimp' is incompatible with this version of Drupal core.

    Can you please look into it?
    Thanks,
    Akul

  • Status changed to Needs review 11 days ago
  • 🇮🇳India akulsaxena

    Hi @xenophyle

    I tried solving the error. The phpcs errors have been taken care of but the PHPUnit error still persists -

    Unable to install modules: module 'mailchimp' is incompatible with this version of Drupal core.

    The error is occurring because the module is compatible with Drupal version 10 while the test cases have been updated to Drupal 11 which the module is incompatible with. The tests need to be made compatible with the module.

    Can you please look into it?
    Thanks,
    Akul

Production build 0.71.5 2024