Fix the issues reported by phpcs

Created on 16 February 2023, almost 2 years ago
Updated 27 February 2024, 9 months ago

Problem/Motivation

C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig account_settings_tab-3342279

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\account_settings_tab.info.yml
----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 1 | WARNING | "core_version_requirement" property is missing in the info.yml file
----------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\account_settings_tab.links.task.yml
----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------
 5 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\account_settings_tab.module
--------------------------------------------------------------------------------------------------------------------
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: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\account_settings_tab.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: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\src\Form\AccountSettingsTabForm.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 66 ERRORS AND 24 WARNINGS AFFECTING 72 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
   9 | WARNING | [x] Unused use statement
  16 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
  30 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  31 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  32 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  33 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  38 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  41 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  42 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
  43 | ERROR   | [x] Short array syntax must be used to define arrays
  47 | ERROR   | [x] Short array syntax must be used to define arrays
  54 | ERROR   | [x] Short array syntax must be used to define arrays
  60 | ERROR   | [x] Short array syntax must be used to define arrays
  61 | ERROR   | [x] Short array syntax must be used to define arrays
  70 | ERROR   | [x] Short array syntax must be used to define arrays
  76 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  80 | ERROR   | [x] Short array syntax must be used to define arrays
  80 | ERROR   | [x] There must be no space between the "array" keyword and the opening parenthesis
  86 | ERROR   | [x] Short array syntax must be used to define arrays
  90 | ERROR   | [x] Short array syntax must be used to define arrays
  99 | ERROR   | [x] Short array syntax must be used to define arrays
 106 | ERROR   | [x] Short array syntax must be used to define arrays
 107 | ERROR   | [ ] The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
 107 | ERROR   | [x] Short array syntax must be used to define arrays
 115 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 116 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 117 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
 118 | ERROR   | [x] No space found before comment text; expected "// Validating while changing the username" but found "//Validating while changing the username"
 118 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 121 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 122 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 123 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 124 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
 124 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 126 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 127 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 128 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 128 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 133 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 136 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 140 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 144 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 146 | ERROR   | [x] Inline comments must start with a capital letter
 146 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 151 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 155 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 164 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 165 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
 166 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 166 | ERROR   | [x] Inline comments must start with a capital letter
 166 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 167 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 168 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 169 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 170 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 171 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 172 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
 173 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
 173 | WARNING | [ ] Messages are user facing text and must run through t() for translation
 174 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
 175 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 176 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 177 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 177 | ERROR   | [x] Inline comments must start with a capital letter
 177 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 178 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 179 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 181 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
 182 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
 183 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
 183 | WARNING | [ ] Messages are user facing text and must run through t() for translation
 184 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
 185 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 185 | ERROR   | [x] Closing brace indented incorrectly; expected 4 spaces, found 6
 186 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 186 | ERROR   | [x] Inline comments must start with a capital letter
 186 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 187 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 188 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 189 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 190 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
 191 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
 191 | WARNING | [ ] Messages are user facing text and must run through t() for translation
 192 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
 193 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 194 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 194 | ERROR   | [x] Closing brace indented incorrectly; expected 2 spaces, found 4
 194 | ERROR   | [x] Expected 1 blank line after function; 0 found
 195 | ERROR   | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 66 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 561ms; Memory: 6MB

Steps to reproduce

Run the following command : phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /Users/sahil.goyal/Documents/MySites/101x/drupal/modules/contrib/account_settings_tab

Proposed resolution

Fix All the php coding standard issues and warnings

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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

  • Issue created by @sidharth_soman
  • Status changed to Needs work almost 2 years ago
  • 🇮🇳India sidharth_soman Bangalore

    Finding the following issues using php codesniffer. I will work them.

    C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig account_settings_tab-3342279
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\account_settings_tab.info.yml
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------
     1 | WARNING | "core_version_requirement" property is missing in the info.yml file
    ----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\account_settings_tab.links.task.yml
    ----------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------
     5 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\account_settings_tab.module
    --------------------------------------------------------------------------------------------------------------------
    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: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\account_settings_tab.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: C:\xampp\htdocs\backendassignment\web\modules\contrib\account_settings_tab-3342279\src\Form\AccountSettingsTabForm.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 66 ERRORS AND 24 WARNINGS AFFECTING 72 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
       1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
       9 | WARNING | [x] Unused use statement
      16 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
      30 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
      31 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
      32 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
      33 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
      38 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
      41 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
      42 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
      43 | ERROR   | [x] Short array syntax must be used to define arrays
      47 | ERROR   | [x] Short array syntax must be used to define arrays
      54 | ERROR   | [x] Short array syntax must be used to define arrays
      60 | ERROR   | [x] Short array syntax must be used to define arrays
      61 | ERROR   | [x] Short array syntax must be used to define arrays
      70 | ERROR   | [x] Short array syntax must be used to define arrays
      76 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
      80 | ERROR   | [x] Short array syntax must be used to define arrays
      80 | ERROR   | [x] There must be no space between the "array" keyword and the opening parenthesis
      86 | ERROR   | [x] Short array syntax must be used to define arrays
      90 | ERROR   | [x] Short array syntax must be used to define arrays
      99 | ERROR   | [x] Short array syntax must be used to define arrays
     106 | ERROR   | [x] Short array syntax must be used to define arrays
     107 | ERROR   | [ ] The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
     107 | ERROR   | [x] Short array syntax must be used to define arrays
     115 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     116 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     117 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
     118 | ERROR   | [x] No space found before comment text; expected "// Validating while changing the username" but found "//Validating while changing the username"
     118 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     121 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     122 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     123 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     124 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     124 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     126 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     127 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     128 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     128 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     133 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     136 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     140 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     144 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     146 | ERROR   | [x] Inline comments must start with a capital letter
     146 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     151 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     155 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     164 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     165 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
     166 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     166 | ERROR   | [x] Inline comments must start with a capital letter
     166 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     167 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     168 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     169 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     170 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     171 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     172 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     173 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     173 | WARNING | [ ] Messages are user facing text and must run through t() for translation
     174 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     175 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     176 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     177 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     177 | ERROR   | [x] Inline comments must start with a capital letter
     177 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     178 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     179 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     181 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
     182 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
     183 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
     183 | WARNING | [ ] Messages are user facing text and must run through t() for translation
     184 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
     185 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     185 | ERROR   | [x] Closing brace indented incorrectly; expected 4 spaces, found 6
     186 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     186 | ERROR   | [x] Inline comments must start with a capital letter
     186 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     187 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     188 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     189 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     190 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
     191 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
     191 | WARNING | [ ] Messages are user facing text and must run through t() for translation
     192 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 10
     193 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     194 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
     194 | ERROR   | [x] Closing brace indented incorrectly; expected 2 spaces, found 4
     194 | ERROR   | [x] Expected 1 blank line after function; 0 found
     195 | ERROR   | [x] The closing brace for the class must have an empty line before it
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 66 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 561ms; Memory: 6MB
    
  • Merge request !1Issue #3342279: PHPCS Errors → (Open) created by sidharth_soman
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India sidharth_soman Bangalore

    All errors resolved except dependency injection.. which should be done in another issue.

    I have opened an MR. Please review.

  • Status changed to Needs work almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, report which command has been used, which arguments have been used, and which report that command shown.

  • Assigned to sahil.goyal
  • 🇮🇳India sahil.goyal

    working on this

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sahil.goyal

    Fixing all the Left php coding standard issues and warnings

      32 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      33 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      34 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      40 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      43 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      44 | WARNING | User::load calls should be avoided in classes, use dependency injection instead
      78 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     120 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     121 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     122 | WARNING | User::load calls should be avoided in classes, use dependency injection instead
     138 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     169 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     170 | WARNING | User::load calls should be avoided in classes, use dependency injection instead
     178 | WARNING | Messages are user facing text and must run through t() for translation
     188 | WARNING | Messages are user facing text and must run through t() for translation
     196 | WARNING | Messages are user facing text and must run through t() for translation
  • 🇮🇳India sahil.goyal

    Updated the issue summery

  • Issue was unassigned.
  • 🇮🇳India nayana_mvr

    Verified MR!1. The patch applied cleanly and it fixes all the php coding standard issues. Need RTBC+1.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +  /**
    +   * Constructs a AccountSettingsTabForm object.
    +   *

    The namespace is missing.

    -      // Validate changing the  email
    +    }
    +    // Validate changing the  email.
    -      if ($name_default_value != $name_value) {
    -        $user_exist = user_load_by_name($name_value);
    -        if (!empty($user_exist)) {
    -          $form_state->setErrorByName('name', t("Username already exist! provide an other username."));
    +    if ($name_default_value != $name_value) {
    +      $user_exist = user_load_by_name($name_value);
    +      if (!empty($user_exist)) {
    +        $form_state->setErrorByName('name', $this->t("Username already exist! provide an other username."));
           if (!empty($current_pass) && $mail_default_value != $mail_value) {
             if (!$authorised) {
    -          $form_state->setErrorByName('mail', t("Please enter the right password to change email.."));
    +          $form_state->setErrorByName('mail', $this->t("Please enter the right password to change email.."));
           if (empty($current_pass) && $mail_default_value != $mail_value) {
    -        $form_state->setErrorByName('mail', t("Enter current password to change Email id."));
    +        $form_state->setErrorByName('mail', $this->t("Enter current password to change Email id."));

    Since those lines are changed, the changes should also:

    • Remove double spaces used instead of a single space
    • Correctly spell words, including the ones at the beginning of a sentence, or words that are acronyms
    • Use the correct punctuation (.. is not used in English.)
    • Use an article where necessary
  • 🇮🇳India Vishal Choudhary Dharmshala

    Hi Team, I am also facing these types of issues in Drupal 10 But, I have Fixed these issues on
    https://www.drupal.org/project/account_settings_tab/issues/3285915#comme... 📌 Automated Drupal 10 compatibility fixes RTBC
    Please check these issue numbers and Test with this patch in our local Setup.

  • 🇮🇳India Meeni_Dhobale

    I am trying to get the pull of the current working branch but always getting the access denied error.

  • First commit to issue fork.
  • Status changed to Needs review 10 months ago
  • 🇮🇳India zkhan.aamir

    Hi,

    I applied MR #15 and it applies cleanly.
    All the error has been resolved.
    Please refer screenshot.

  • Status changed to Needs work 10 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • First commit to issue fork.
  • Status changed to Needs review 9 months ago
Production build 0.71.5 2024