Fix the warnings/errors reported by PHP_CodeSniffer

Created on 9 May 2023, over 1 year ago
Updated 21 August 2024, 3 months ago
๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia himanshu_jhaloya Indore

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 @himanshu_jhaloya
  • @himanshu_jhaloya opened merge request.
  • Assigned to himanshu_jhaloya
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to Active over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    I am resetting the Assigned field, since it should be used from somebody who is going to work on the issue in few time. himanshu_jhaloya has not worked on this issue in the past two months.

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

    Please review.

  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi,

    I reviewed the changes and confirmed that Patch #9 was applied cleanly to the Website Services Branch Menu module against 1.0.x-dev on Drupal 9.5.10.

    Checking patch assets/css/y_branch_menu.css...
    Checking patch src/Plugin/Block/BranchMenuBlock.php...
    Checking patch y_branch_menu.info.yml...
    Checking patch y_branch_menu.module...
    Applied patch assets/css/y_branch_menu.css cleanly.
    Applied patch src/Plugin/Block/BranchMenuBlock.php cleanly.
    Applied patch y_branch_menu.info.yml cleanly.
    Applied patch y_branch_menu.module cleanly.

    And all PHPCS errors have been fixed.

    I ran this command:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml y_branch_menu

    Please see the attached files for reference.

    I'm moving this now to RTBC.

    Thank you!

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
        * @return array|Link
    +   *   The Link object array.

    The returned value is actually a Link, not an array of Link objects.
    @return array|Link is not correct and must be changed too.

    +   * @param \Drupal\Core\Link $fieldBranchMenuLinks
    +   *   The Links of field.

    Actually that is a single Link object. The description should better describe which Link object that is.

    +   * @param int $limit
    +   *   Number of links returned.

    It should be The number of returned links.

    +   * @return array
    +   *   The array of links.

    An array of links. is better.

  • Assigned to imustakim
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad

    Patch updated and interdiff attached.
    Please review.

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi,

    I reviewed the latest changes and confirmed that Patch #14 was applied cleanly and no PHPCS errors were found.

    Checking patch assets/css/y_branch_menu.css...
    Checking patch src/Plugin/Block/BranchMenuBlock.php...
    Checking patch y_branch_menu.info.yml...
    Checking patch y_branch_menu.module...
    Applied patch assets/css/y_branch_menu.css cleanly.
    Applied patch src/Plugin/Block/BranchMenuBlock.php cleanly.
    Applied patch y_branch_menu.info.yml cleanly.
    Applied patch y_branch_menu.module cleanly.

    I re-ran this command on the module:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml y_branch_menu/

    Please see the attached file for reference.

    Moving this again to RTBC.

    Thank you!

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine podarok Ukraine

    css files are automatically generated from node-sass build, please check package.json
    ignore css files in CodeSniffer, please

    Also, create Merge Request instead of patches - we are in 21st century, guys

  • Assigned to imustakim
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad

    Hey, @podarok, Didn't know about the css.
    Raised the MR and removed the css changes.
    Please review.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi @imustakim,

    I reviewed your changes and after applying the MR !12 on the module, there were coding standard issues found by the PHPCS:

    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/y_branch_menu/assets/css/y_branch_menu.css
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 104 ERRORS AFFECTING 87 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
      6 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
      7 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      7 | ERROR | [x] Closing brace of class definition must be on new line
     11 | ERROR | [x] Closing brace of class definition must be on new line
     12 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     21 | ERROR | [x] Closing brace of class definition must be on new line
     22 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     25 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     27 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     30 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     32 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     33 | ERROR | [x] CSS colours must be defined in lowercase; expected #e9e9e9 but found #E9E9E9
     34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     34 | ERROR | [x] Closing brace of class definition must be on new line
     35 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
     36 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     37 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
     37 | ERROR | [x] Closing brace of class definition must be on new line
     38 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     39 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     39 | ERROR | [x] Closing brace of class definition must be on new line
     40 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     42 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     43 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     44 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     44 | ERROR | [x] Closing brace of class definition must be on new line
     45 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     47 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
     48 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
     49 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
     49 | ERROR | [x] Closing brace of class definition must be on new line
     50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     51 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
     51 | ERROR | [x] Closing brace of class definition must be on new line
     52 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     53 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     54 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     55 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     55 | ERROR | [x] Closing brace of class definition must be on new line
     56 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
     57 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     58 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
     59 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
     60 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
     60 | ERROR | [x] Closing brace of class definition must be on new line
     61 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
     62 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     63 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     64 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     65 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     66 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     67 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
     67 | ERROR | [x] Closing brace of class definition must be on new line
     68 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 8
     69 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     70 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 12
     71 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 12
     72 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 12
     73 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 12
     73 | ERROR | [x] Closing brace of class definition must be on new line
     74 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 8
     75 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     76 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     76 | ERROR | [x] Closing brace of class definition must be on new line
     77 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 8
     78 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     79 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     80 | ERROR | [x] Closing brace of class definition must be on new line
     81 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 8
     82 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     83 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     84 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     85 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     86 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     87 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     88 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     89 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
     89 | ERROR | [x] Closing brace of class definition must be on new line
     90 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 10
     91 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 12
     92 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 14
     92 | ERROR | [x] Closing brace of class definition must be on new line
     94 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 104 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------
    
    Time: 229ms; Memory: 10MB

    I re-ran this command on the module after the MR applied:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml y_branch_menu/

    Moving this now to Needs work for investigations.

    Thank you!

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad

    @roberttabigue please remove css from your phpcs command, Refer #16.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • bindu r โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    As per comment #16 removing css from phpcs command because the css is auto generating from node-sass build,
    The MR #12 resolves all the phpcs issues.

    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 y_branch_menu/
    
    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib
    $
    
    
    
  • Assigned to zniki.ru
  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡ท๐Ÿ‡บRussia zniki.ru

    I will fix the conflicts in the MR.
    Update IS: provide command, update phpcs report.

  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ท๐Ÿ‡บRussia zniki.ru

    MR conflicts solved, I removed changes that is not part of the latest phpcs report.
    Ready for review.

  • ๐Ÿ‡ท๐Ÿ‡บRussia zniki.ru

    Hide all files.

  • ๐Ÿ‡ท๐Ÿ‡บRussia zniki.ru

    Hide one more file, please use MR workflow.

  • ๐Ÿ‡ท๐Ÿ‡บRussia zniki.ru
  • Status changed to RTBC 3 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi,

    I have applied the latest MR !12 to the Website Services Branch Menu module with 1.0.x-dev on Drupal 10 and confirmed all PHPCS errors have been fixed.

    I ran this command on the module:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,inc,module,install,info,test,profile,theme y_branch_menu/

    Please see the attached file for reference.

    I'm moving this now to โ€˜RTBCโ€™.

    Thank you!

  • Pipeline finished with Success
    3 months ago
    Total: 146s
    #260657
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    avpaderno โ†’ changed the visibility of the branch 3359070-gitlab-ci-reports to hidden.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Pipeline finished with Success
    3 months ago
    #260676
Production build 0.71.5 2024