Created on 20 June 2017, over 7 years ago
Updated 14 July 2024, 5 months ago

I'm found drupal coding standards error in module please fixed it.

๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Mayankkumar Jeshti Vadodara

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    silvi.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !1Fixed phpcs issues. โ†’ (Open) created by Unnamed author
  • Status changed to Needs review 6 months ago
  • Status changed to RTBC 5 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi

    I applied MR !1 and I confirmed that it fixes all PHPCS issues

    โžœ  donation_button git:(8.x-1.x) curl https://git.drupalcode.org/project/donation_button/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  9241    0  9241    0     0  17708      0 --:--:-- --:--:-- --:--:-- 17978
    patching file 'config/install/donation_button.settings.yml'
    patching file donation_button.info.yml
    patching file donation_button.module
    patching file donation_button.routing.yml
    patching file 'src/Form/DonationButtonConfigurationForm.php'
    patching file 'src/Form/DonationButtonForm.php'
    patching file 'src/Plugin/Block/DonationButtonBlock.php'
    โžœ  donation_button git:(8.x-1.x) โœ— ..
    โžœ  contrib git:(main) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml donation_button 
    โžœ  contrib git:(main) โœ— 
    

    Before I apply the MR, below are the PHPCS issues in the module

    โžœ  contrib git:(main) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml donation_button
    
    FILE: ...odules/contrib/donation_button/config/install/donation_button.settings.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: ...upal_local/web/modules/contrib/donation_button/donation_button.routing.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     14 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: .../drupal_local/web/modules/contrib/donation_button/donation_button.info.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     1 | WARNING | [ ] "core_version_requirement" property is missing in the
       |         |     info.yml file
     4 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...10/drupal_local/web/modules/contrib/donation_button/donation_button.module
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     3 | ERROR | [x] You must use "/**" style comments for a file comment
     3 | ERROR | [x] Whitespace found at end of line
     7 | ERROR | [x] Expected 1 newline at end of file; 2 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...dules/contrib/donation_button/src/Form/DonationButtonConfigurationForm.php
    --------------------------------------------------------------------------------
    FOUND 14 ERRORS AND 1 WARNING AFFECTING 15 LINES
    --------------------------------------------------------------------------------
      3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin
        |         |     with a file doc comment
      5 | ERROR   | [ ] Doc comment short description must end with a full stop
      7 | ERROR   | [x] There must be one blank line after the namespace
        |         |     declaration
     13 | ERROR   | [x] There must be exactly one blank line before the tags in a
        |         |     doc comment
     15 | ERROR   | [x] PHP keywords must be lowercase; expected "class" but found
        |         |     "Class"
     19 | ERROR   | [x] Expected 1 blank line before function; 0 found
     23 | ERROR   | [x] Expected 1 blank line after function; 0 found
     29 | ERROR   | [x] Expected 1 blank line after function; 0 found
     34 | ERROR   | [x] Whitespace found at end of line
     76 | ERROR   | [x] Expected 1 blank line after function; 0 found
     86 | ERROR   | [x] Whitespace found at end of line
     87 | WARNING | [ ] Unused variable $config.
     93 | ERROR   | [x] Whitespace found at end of line
     95 | ERROR   | [x] Expected 1 blank line after function; 0 found
     96 | ERROR   | [x] The closing brace for the Class must have an empty line
        |         |     before it
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ..._local/web/modules/contrib/donation_button/src/Form/DonationButtonForm.php
    --------------------------------------------------------------------------------
    FOUND 23 ERRORS AND 5 WARNINGS AFFECTING 24 LINES
    --------------------------------------------------------------------------------
      3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin
        |         |     with a file doc comment
      8 | ERROR   | [x] There must be one blank line after the namespace
        |         |     declaration
     12 | ERROR   | [x] Missing class doc comment
     16 | ERROR   | [x] Expected 1 blank line before function; 0 found
     18 | ERROR   | [x] Expected 1 blank line after function; 2 found
     19 | ERROR   | [x] Whitespace found at end of line
     20 | ERROR   | [x] Whitespace found at end of line
     25 | ERROR   | [x] Whitespace found at end of line
     26 | ERROR   | [x] Whitespace found at end of line
     28 | ERROR   | [x] Short array syntax must be used to define arrays
     30 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     33 | ERROR   | [x] Short array syntax must be used to define arrays
     35 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     38 | ERROR   | [x] Short array syntax must be used to define arrays
     40 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     44 | ERROR   | [x] Short array syntax must be used to define arrays
     46 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     49 | ERROR   | [x] Short array syntax must be used to define arrays
     51 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     53 | ERROR   | [x] Whitespace found at end of line
     54 | ERROR   | [x] Short array syntax must be used to define arrays
     66 | ERROR   | [x] Whitespace found at end of line
     67 | ERROR   | [x] Expected 1 blank line after function; 0 found
     67 | ERROR   | [x] Whitespace found at end of line
     68 | ERROR   | [x] The closing brace for the class must have an empty line
        |         |     before it
     68 | ERROR   | [ ] Closing class brace must be on a line by itself
     68 | ERROR   | [x] Expected 1 newline at end of file; 0 found
     68 | ERROR   | [x] Whitespace found at end of line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 22 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...b/modules/contrib/donation_button/src/Plugin/Block/DonationButtonBlock.php
    --------------------------------------------------------------------------------
    FOUND 6 ERRORS AND 1 WARNING AFFECTING 6 LINES
    --------------------------------------------------------------------------------
      3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin
        |         |     with a file doc comment
     19 | ERROR   | [x] There must be exactly one newline after the class comment
     22 | ERROR   | [x] Whitespace found at end of line
     27 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
        |         |     injection instead
     29 | ERROR   | [x] Expected 1 blank line after function; 0 found
     30 | ERROR   | [x] Expected 1 newline at end of file; 2 found
     30 | ERROR   | [x] The closing brace for the class must have an empty line
        |         |     before it
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 125ms; Memory: 10MB
    
    โžœ  contrib git:(main) โœ— 
    
Production build 0.71.5 2024