Drupal Coding Standards Issues | phpcs

Created on 16 January 2023, over 1 year ago
Updated 4 February 2023, over 1 year ago

Problem/Motivation

Getting Following errors/warnings

FILE: .../contrib/token_filter/src/Plugin/CKEditorPlugin/TokenBrowser.php
----------------------------------------------------------------------
FOUND 20 ERRORS AND 2 WARNINGS AFFECTING 16 LINES
----------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
61 | ERROR | [ ] Parameter $configuration is not described in
| | comment
61 | ERROR | [ ] Parameter $plugin_id is not described in comment
61 | ERROR | [ ] Parameter $plugin_definition is not described in
| | comment
61 | ERROR | [ ] Parameter $token_service is not described in
| | comment
61 | ERROR | [ ] Parameter $file_url_generator is not described
| | in comment
61 | ERROR | [ ] Parameter $module_extension_list is not
| | described in comment
64 | ERROR | [ ] Missing parameter comment
67 | ERROR | [x] Expected 1 space between type hint and argument
| | "$configuration"; 21 found
70 | ERROR | [x] Expected 1 space between type hint and argument
| | "$csrf_token_service"; 8 found
71 | ERROR | [x] Expected 1 space between type hint and argument
| | "$token_service"; 21 found
73 | ERROR | [x] Expected 1 space between type hint and argument
| | "$module_extension_list"; 7 found
82 | ERROR | [x] Missing function doc comment
105 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
115 | ERROR | [ ] Return type "\Drupal\Core\Url The URL." must not
| | contain spaces
118 | ERROR | [x] Trailing punctuation for @see references is not
| | allowed.
136 | ERROR | [ ] The @see reference should not contain any
| | additional text
212 | ERROR | [x] Line indented incorrectly; expected at least 8
| | spaces, found 6
213 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
| | found 4
213 | ERROR | [x] Closing brace indented incorrectly; expected 6
| | spaces, found 4
229 | ERROR | [x] Expected 1 blank line after function; 0 found
230 | ERROR | [x] The closing brace for the class must have an
| | empty line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...p/modules/contrib/token_filter/src/Plugin/Filter/TokenFilter.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
130 | ERROR | The array declaration extends to column 100 (the limit
| | is 80). The array content should be split up over
| | multiple lines
----------------------------------------------------------------------

FILE: /app/modules/contrib/token_filter/token_filter.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added
| | by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be
| | added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added
| | by drupal.org packaging automatically
----------------------------------------------------------------------

Time: 1.61 secs; Memory: 10MB

Steps to reproduce

phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/token_filter

Proposed resolution

Fix the errors and warnings.

๐Ÿ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia shivam-kumar

Live updates comments and jobs are added and updated live.
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.

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

    The issues mentioned in the description related to info.yml file are the details drupal.org adds and you won't see them when you git clone a project.

    I found one phpcs issue related to using t() in class and I have fixed that. Added interdiff and updated patch files.

    All phpcs issues are fixed now.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

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

  • @charchil-khandelwal opened merge request.
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    Created MR!
    Thanks @hardikpandya, Patch #7 applied cleanly, and all errors and warnings are fixed.
    So moving it to RTBC.
    Thanks

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    Made one comment on the MR, hiding patches now we're using MRs

  • Assigned to darvanen
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    Can't seem to use the MR locally due to the branch name, I'm going to make a few edits and commit this so I can launch a full version.

    • dc9743bb committed on 2.x
      Issue #3333841 by Charchil Khandelwal, hardikpandya, shivam-kumar, Prem...
  • Status changed to Fixed over 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024