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.
| Comment | File | Size | Author |
|---|
Issue fork token_filter-3333841
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
shivam-kumar commentedFixed the issue's errors and warnings. Needs review.
Comment #3
darvanenThanks for this attempt! However, the patch does not address all of the issues raised by phpcs.
On visual inspection of the patch I found this:
Empty doc blocks will fail phpcs.
It looks like you have run phpcbf and submitted that as a patch, this is not enough to satisfy the requirements of this issue. Please continue to manually address all of the phpcs issues until you can run phpcs without it returning any results.
Comment #4
prem suthar commentedFix All Phpcs Errors plz Review it.
Comment #5
prem suthar commentedComment #6
darvanenThanks @Prem Suthar, you appear to have missed the requirements for
token_filter.info.yml. See the issue summary for the full list of issues, and do run phpcs to check your work please.Also please always provide an interdiff when working with patches :)
Comment #7
hardikpandya commentedThe 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.
Comment #10
Charchil Khandelwal commentedCreated MR!
Thanks @hardikpandya, Patch #7 applied cleanly, and all errors and warnings are fixed.
So moving it to RTBC.
Thanks
Comment #11
darvanenMade one comment on the MR, hiding patches now we're using MRs
Comment #12
darvanenCan'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.
Comment #14
darvanen