Fix the issues reported by phpcs

Created on 10 April 2023, almost 2 years ago
Updated 20 August 2024, 5 months ago

Problem/Motivation

FILE: /views_tools/src/Form/BulkOperationForm.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 55 | WARNING | Possible useless method overriding detected
----------------------------------------------------------------------------------------------

FILE: /views_tools/src/Form/DeleteDisplayConfirm.php
---------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------
 67 | ERROR | Parameter $form is not described in comment
 67 | ERROR | Parameter $form_state is not described in comment
 67 | ERROR | Parameter $view is not described in comment
 85 | ERROR | The array declaration extends to column 115 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------

FILE: /views_tools/src/Controller/ViewsToolsController.php
---------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 9 LINES
---------------------------------------------------------------------------------------------------------------
  22 | ERROR | Missing member variable doc comment
  23 | ERROR | Missing member variable doc comment
  24 | ERROR | Missing member variable doc comment
  25 | ERROR | Missing member variable doc comment
  92 | ERROR | The array declaration extends to column 130 (the limit is 80). The array content should be split up over multiple lines
  96 | ERROR | The array declaration extends to column 127 (the limit is 80). The array content should be split up over multiple lines
 100 | ERROR | The array declaration extends to column 132 (the limit is 80). The array content should be split up over multiple lines
 104 | ERROR | The array declaration extends to column 135 (the limit is 80). The array content should be split up over multiple lines
 118 | ERROR | The array declaration extends to column 108 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------

Steps to reproduce

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

Proposed resolution

Fix the warnings and errors.

šŸ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India Binoli Lalani Gujarat

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

Comments & Activities

  • Issue created by @Binoli Lalani
  • @binoli-lalani opened merge request.
  • @binoli-lalani opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • šŸ‡®šŸ‡³India Binoli Lalani Gujarat

    Hello,

    Please review MR.

    Thank you!

  • Status changed to Needs work 5 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @binoli lalani,

    I applied MR!2, it was applied smoothly and fixed most of the phpcs issues.

    These are the remaining issues after I ran phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml:

    āžœ  views_tools git:(2.0.x) curl https://git.drupalcode.org/project/views_tools/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4791    0  4791    0     0  14268      0 --:--:-- --:--:-- --:--:-- 14301
    patching file src/Controller/ViewsToolsController.php
    patching file src/Form/BulkOperationForm.php
    patching file src/Form/DeleteDisplayConfirm.php
    āžœ  views_tools git:(2.0.x) āœ— ..
    āžœ  contrib phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml views_tools
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/views_tools/src/Controller/ViewsToolsController.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Link.
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/views_tools/src/ViewsTools.php
    ---------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\Yaml\Yaml.
    ---------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------
    
    Time: 144ms; Memory: 8MB
    
    āžœ  contrib

    Thank you.

Production build 0.71.5 2024