Fix the issues reported by phpcs

Created on 29 June 2022, about 3 years ago
Updated 17 July 2024, about 1 year ago

Fixed the issues reported by phpcs

๐Ÿ“Œ Task
Status

Needs work

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Rakhi Soni

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    -function _setCustomPageVariables($variables){
    -    $variables['medical_website'] = [
    -        'content_401' => theme_get_setting('401_content')['value'],
    -        'content_403' => theme_get_setting('403_content')['value'],
    -        'content_404' => theme_get_setting('404_content')['value'],
    -    ];
    -    return $variables;
    +/**
    + * {@inheritdoc}
    + */
    +function _set_custom_page_variables($variables) {
    +  $variables['medical_website'] = [
    +    'content_401' => theme_get_setting('401_content')['value'],
    +    'content_403' => theme_get_setting('403_content')['value'],
    +    'content_404' => theme_get_setting('404_content')['value'],
    +  ];
    +  return $variables;
     }

    Neither the existing function name nor the changed function name are correct, as per Drupal coding standards.

     /**
    - * Implement settings
    + * Implement settings.
      */
     function medical_website_form_system_theme_settings_alter(&$form, FormStateInterface $form_state) {
       $form['medical_website_settings'] = [

    That is not the documentation comment for a hook implementation.

  • bindu r โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    Hi,

    Patch #6 applied successfully.
    No errors remianing.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/mayursolaskar-3262701 (1.0.x)
    $ curl https://www.drupal.org/files/issues/2023-11-29/phpcs-fix-3293361.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 11554  100 11554    0     0  23670      0 --:--:-- --:--:-- --:--:-- 23724
    patching file config/install/block_content.type.basic.yml
    patching file config/install/block_content.type.offeronproduct.yml
    patching file config/install/core.entity_view_display.node.article.medical_website_card.yml
    patching file config/install/core.entity_view_mode.node.medical_website_card.yml
    patching file medical_website.breakpoints.yml
    patching file medical_website.info.yml
    patching file medical_website.libraries.yml
    patching file medical_website.theme
    patching file theme-settings.php
    
    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib
    $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,js,yml mayursolaskar-3262701/
    
    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib
    $
    
    
  • Status changed to Needs work about 1 year ago
  • Hi @pray12,

    The patch you provided was applied successfully, however, there are still errors reported. Please see below:

    mayursolaskar-3262701 git:(1.0.x) curl https://www.drupal.org/files/issues/2023-11-29/phpcs-fix-3293361.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 11554  100 11554    0     0  39054      0 --:--:-- --:--:-- --:--:-- 40118
    patching file config/install/block_content.type.basic.yml
    patching file config/install/block_content.type.offeronproduct.yml
    patching file config/install/core.entity_view_display.node.article.medical_website_card.yml
    patching file config/install/core.entity_view_mode.node.medical_website_card.yml
    patching file medical_website.breakpoints.yml
    patching file medical_website.info.yml
    patching file medical_website.libraries.yml
    patching file medical_website.theme
    patching file theme-settings.php
    โžœ  mayursolaskar-3262701 git:(1.0.x) โœ— cd ..
    โžœ  contrib git:(master) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig mayursolaskar-3262701
    
    FILE: ...-v9/web/modules/contrib/mayursolaskar-3262701/style/css/component/card.css
    --------------------------------------------------------------------------------
    FOUND 8 ERRORS AFFECTING 6 LINES
    --------------------------------------------------------------------------------
      3 | ERROR | [x] CSS colours must be defined in lowercase; expected #f1f1f1
        |       |     but found #F1F1F1
      5 | ERROR | [x] Closing brace of class definition must be on new line
     10 | ERROR | [x] Closing brace of class definition must be on new line
     14 | ERROR | [x] CSS colours must be defined in lowercase; expected #1eefac
        |       |     but found #1EEFAC
     14 | ERROR | [x] Closing brace of class definition must be on new line
     18 | ERROR | [x] Closing brace of class definition must be on new line
     21 | ERROR | [x] CSS colours must be defined in lowercase; expected #ffffff
        |       |     but found #FFFFFF
     21 | ERROR | [x] Closing brace of class definition must be on new line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...odules/contrib/mayursolaskar-3262701/style/css/component/middlecontent.css
    --------------------------------------------------------------------------------
    FOUND 25 ERRORS AFFECTING 23 LINES
    --------------------------------------------------------------------------------
      2 | ERROR | [x] Closing brace of class definition must be on new line
      5 | ERROR | [x] Closing brace of class definition must be on new line
      9 | ERROR | [x] CSS colours must be defined in lowercase; expected #81f090
        |       |     but found #81F090
     11 | ERROR | [x] Closing brace of class definition must be on new line
     16 | ERROR | [x] CSS colours must be defined in lowercase; expected #8403f9
        |       |     but found #8403F9
     17 | ERROR | [x] Closing brace of class definition must be on new line
     21 | ERROR | [x] Closing brace of class definition must be on new line
     27 | ERROR | [x] Closing brace of class definition must be on new line
     30 | ERROR | [x] CSS colours must be defined in lowercase; expected #f44336
        |       |     but found #F44336
     31 | ERROR | [x] Closing brace of class definition must be on new line
     35 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     36 | ERROR | [x] Closing brace of class definition must be on new line
     39 | ERROR | [x] Closing brace of class definition must be on new line
     42 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     42 | ERROR | [x] CSS colours must be defined in lowercase; expected #e8b5ce
        |       |     but found #E8B5CE
     42 | ERROR | [x] Closing brace of class definition must be on new line
     45 | ERROR | [x] Closing brace of class definition must be on new line
     48 | ERROR | [x] CSS colours must be defined in lowercase; expected #1f2947
        |       |     but found #1F2947
     49 | ERROR | [x] Closing brace of class definition must be on new line
     53 | ERROR | [x] Closing brace of class definition must be on new line
     56 | ERROR | [x] Closing brace of class definition must be on new line
     59 | ERROR | [x] CSS colours must be defined in lowercase; expected #81f090
        |       |     but found #81F090
     60 | ERROR | [x] CSS colours must be defined in lowercase; expected #f44336
        |       |     but found #F44336
     61 | ERROR | [x] Closing brace of class definition must be on new line
     65 | ERROR | [x] Closing brace of class definition must be on new line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 25 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...-v9/web/modules/contrib/mayursolaskar-3262701/style/css/component/dark.css
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
     2 | ERROR | [x] Closing brace of class definition must be on new line
     5 | ERROR | [x] Closing brace of class definition must be on new line
     8 | ERROR | [x] Closing brace of class definition must be on new line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...9/web/modules/contrib/mayursolaskar-3262701/style/css/component/navbar.css
    --------------------------------------------------------------------------------
    FOUND 21 ERRORS AFFECTING 15 LINES
    --------------------------------------------------------------------------------
      2 | ERROR | [x] Closing brace of class definition must be on new line
      9 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
      9 | ERROR | [x] Closing brace of class definition must be on new line
     13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     17 | ERROR | [x] Closing brace of class definition must be on new line
     20 | ERROR | [x] Closing brace of class definition must be on new line
     23 | ERROR | [x] CSS colours must be defined in lowercase; expected #006b00
        |       |     but found #006B00
     23 | ERROR | [x] Closing brace of class definition must be on new line
     27 | ERROR | [x] CSS colours must be defined in lowercase; expected #ffffff
        |       |     but found #FFFFFF
     29 | ERROR | [x] Closing brace of class definition must be on new line
     32 | ERROR | [x] CSS colours must be defined in lowercase; expected #ffc0cb
        |       |     but found #FFC0CB
     32 | ERROR | [x] Closing brace of class definition must be on new line
     35 | ERROR | [x] CSS colours must be defined in lowercase; expected #1002e8
        |       |     but found #1002E8
     35 | ERROR | [x] Closing brace of class definition must be on new line
     40 | ERROR | [x] CSS colours must be defined in lowercase; expected #006b00
        |       |     but found #006B00
     41 | ERROR | [x] CSS colours must be defined in lowercase; expected #8bc34a
        |       |     but found #8BC34A
     41 | ERROR | [x] Closing brace of class definition must be on new line
     44 | ERROR | [x] Closing brace of class definition must be on new line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 21 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...9/web/modules/contrib/mayursolaskar-3262701/style/css/component/footer.css
    --------------------------------------------------------------------------------
    FOUND 7 ERRORS AFFECTING 5 LINES
    --------------------------------------------------------------------------------
      2 | ERROR | [x] CSS colours must be defined in lowercase; expected #424a52
        |       |     but found #424A52
      2 | ERROR | [x] Closing brace of class definition must be on new line
      5 | ERROR | [x] CSS colours must be defined in lowercase; expected #424a52
        |       |     but found #424A52
      5 | ERROR | [x] Closing brace of class definition must be on new line
      8 | ERROR | [x] CSS colours must be defined in lowercase; expected #81f090
        |       |     but found #81F090
      9 | ERROR | [x] Closing brace of class definition must be on new line
     12 | ERROR | [x] Closing brace of class definition must be on new line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...v9/web/modules/contrib/mayursolaskar-3262701/templates/form/form.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     16 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: .../web/modules/contrib/mayursolaskar-3262701/templates/layout/page.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     78 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...modules/contrib/mayursolaskar-3262701/templates/layout/page--404.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     15 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...modules/contrib/mayursolaskar-3262701/templates/layout/page--403.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     11 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...modules/contrib/mayursolaskar-3262701/templates/layout/page--401.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     11 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...web/modules/contrib/mayursolaskar-3262701/templates/content/node.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     93 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...262701/templates/content/node--page--medical_website_serviceinfo.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     86 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...ar-3262701/templates/content/node--article--medical_website_card.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     86 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...b/mayursolaskar-3262701/templates/custom/includes/footers/footer.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     38 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...b/mayursolaskar-3262701/templates/custom/includes/headers/header.html.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     33 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: .../modules/contrib/mayursolaskar-3262701/templates/custom/macros/header.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     11 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: .../modules/contrib/mayursolaskar-3262701/templates/custom/macros/footer.twig
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     11 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 189ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • Assigned to bhaveshdas
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia bhaveshdas

    i have fixed phpcs issues commit -> dab6101d82ecb5bcfcbcd9ccc446530e379fe158
    could you please review it.

    thankyou !

Production build 0.71.5 2024