Fix the issues reported by phpcs

Created on 22 February 2023, over 1 year ago
Updated 22 March 2024, 3 months ago

Coding standards fixes remaining


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 weight/

FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\weight\views\views_handler_weight_selector.inc
-------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------
   6 | ERROR   | Class name must begin with a capital letter
   6 | ERROR   | Class name must use UpperCamel naming without underscores
   6 | WARNING | Class name must be prefixed with the project name "Weight"
  28 | ERROR   | Public method name "views_handler_weight_selector::option_definition" is not in lowerCamel format
  46 | ERROR   | Public method name "views_handler_weight_selector::options_form" is not in lowerCamel format
  91 | ERROR   | Public method name "views_handler_weight_selector::views_form" is not in lowerCamel format
 158 | ERROR   | Public method name "views_handler_weight_selector::views_form_submit" is not in lowerCamel format
-------------------------------------------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\weight\weight.module
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 153 | WARNING | Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
     |         | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
 192 | WARNING | Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
     |         | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 357ms; Memory: 10MB

Steps to reproduce
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml weight/

๐Ÿ“Œ Task
Status

Needs review

Version

3.0

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

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 @VladimirAus
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia
  • First commit to issue fork.
  • First commit to issue fork.
  • Made commit to fix some more issues in phpcs. However 1 warning is remaining which cannot be solved.

    FILE: /var/www/html/web/modules/contrib/weight-3343609/weight.views.inc
    -----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------
    17 | WARNING | Unused variable $table_name.
    -----------------------------------------------------------------------

    we cannot remove the $table_name variable from the foreach loop because it is used as a key in the $data array. Removing it would cause an error in the loop, as it would not be possible to access the data in the $data array without the key.

  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    Thanks for commit. phpcs return other errors

    FILE: /Users/tesboss/_PROJECTS/drupal/weight/weight.module
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
     153 | WARNING | Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
         |         | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
     192 | WARNING | Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
         |         | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/weight/weight.install
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     78 | ERROR | Doc comment is empty
    ----------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/weight/views/views_handler_weight_selector.inc
    -------------------------------------------------------------------------------------------------------------------
    FOUND 14 ERRORS AND 2 WARNINGS AFFECTING 14 LINES
    -------------------------------------------------------------------------------------------------------------------
       3 | ERROR   | Doc comment is empty
       6 | ERROR   | Class name must begin with a capital letter
       6 | ERROR   | Class name must use UpperCamel naming without underscores
       6 | WARNING | Class name must be prefixed with the project name "Weight"
       8 | ERROR   | Doc comment is empty
      17 | ERROR   | Doc comment is empty
      20 | ERROR   | Public method name "views_handler_weight_selector::option_definition" is not in lowerCamel format
      30 | ERROR   | Doc comment is empty
      33 | ERROR   | Public method name "views_handler_weight_selector::options_form" is not in lowerCamel format
      47 | ERROR   | Doc comment is empty
      54 | ERROR   | Doc comment is empty
      61 | ERROR   | Doc comment is empty
      64 | ERROR   | Public method name "views_handler_weight_selector::views_form" is not in lowerCamel format
      91 | WARNING | Line exceeds 80 characters; contains 83 characters
     123 | ERROR   | Doc comment is empty
     126 | ERROR   | Public method name "views_handler_weight_selector::views_form_submit" is not in lowerCamel format
    -------------------------------------------------------------------------------------------------------------------
    
    
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nmorin Huntsville, AL

    Getting Error when attempting to update weight module... Is this related to the errors in the previous comments?

    PHP Parse error:  syntax error, unexpected '?', expecting ')' in /var/www/drupalbase/sites/all/modules/weight/weight.install on line 39
    Drush command terminated abnormally due to an unrecoverable error.                                                                           [error]
    Error: syntax error, unexpected '?', expecting ')' in /var/www/drupalbase/sites/all/modules/weight/weight.install, line 39
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dhigby

    I got the same "unexpected '?'" error, reported here: https://www.drupal.org/project/weight/issues/3344820 ๐Ÿ› Apache 500 error with 7.x-3.2 Needs review

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    Patch was pushed for testing for ๐Ÿ› Apache 500 error with 7.x-3.2 Needs review .
    Please test.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • First commit to issue fork.
  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    Hi,

    MR #15 applied successfully.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/weight (7.x-3.x)
    $ curl https://git.drupalcode.org/project/weight/-/merge_requests/10.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 16773    0 16773    0     0  17530      0 --:--:-- --:--:-- --:--:-- 17544
    patching file .gitlab-ci.yml
    patching file README.md (renamed from README.txt)
    patching file views/views_handler_weight_selector.inc
    patching file views/weight.views.inc
    patching file weight.install
    patching file weight.module
    

    Remaining 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 weight/
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\weight\views\views_handler_weight_selector.inc
    -------------------------------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AND 1 WARNING AFFECTING 5 LINES
    -------------------------------------------------------------------------------------------------------------------
       6 | ERROR   | Class name must begin with a capital letter
       6 | ERROR   | Class name must use UpperCamel naming without underscores
       6 | WARNING | Class name must be prefixed with the project name "Weight"
      28 | ERROR   | Public method name "views_handler_weight_selector::option_definition" is not in lowerCamel format
      46 | ERROR   | Public method name "views_handler_weight_selector::options_form" is not in lowerCamel format
      91 | ERROR   | Public method name "views_handler_weight_selector::views_form" is not in lowerCamel format
     158 | ERROR   | Public method name "views_handler_weight_selector::views_form_submit" is not in lowerCamel format
    -------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\weight\weight.module
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     153 | WARNING | Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
         |         | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
     192 | WARNING | Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
         |         | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 357ms; Memory: 10MB
    
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    Issue summary updated.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Preethy_ray

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

  • Pipeline finished with Failed
    4 months ago
    Total: 164s
    #113503
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Yashaswi18

    Hello, after checking out to the branch '3343609-7.x-phpcs-coding', found these errors remaining :

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,js,yml weight/

    FILE: /home/yashaswi/contribs/weight/views/views_handler_weight_selector.inc
    -------------------------------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AND 1 WARNING AFFECTING 5 LINES
    -------------------------------------------------------------------------------------------------------------------
    6 | ERROR | Class name must begin with a capital letter
    6 | ERROR | Class name must use UpperCamel naming without underscores
    6 | WARNING | Class name must be prefixed with the project name "Weight"
    28 | ERROR | Public method name "views_handler_weight_selector::option_definition" is not in lowerCamel format
    46 | ERROR | Public method name "views_handler_weight_selector::options_form" is not in lowerCamel format
    91 | ERROR | Public method name "views_handler_weight_selector::views_form" is not in lowerCamel format
    158 | ERROR | Public method name "views_handler_weight_selector::views_form_submit" is not in lowerCamel format
    -------------------------------------------------------------------------------------------------------------------

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 134s
    #126001
  • Status changed to Needs review 3 months ago
Production build 0.69.0 2024