Problem/Motivation
Getting following warnings.
FILE: /var/www/html/modules/contrib/rsg/src/RandomGenerator.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
182 | WARNING | Exceptions should not be translated
182 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
Time: 2.04 secs; Memory: 6MB
Steps to reproduce
Run following command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/rsg/
Proposed resolution
Above warnings need to be fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | rsg-after-patch.png | 23.68 KB | rishu_kumar |
| #2 | 3335596-2.patch | 511 bytes | samitk |
Issue fork rsg-3335596
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
samitk commentedAbove warnings are fixed.
Comment #3
charchil khandelwal commentedComment #4
charchil khandelwal commentedThe patch #2 has been reviewed and applied cleanly, but a few phpcs still remain.
FILE: C:\Users\Admin\Downloads\rsg\rsg.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: 539ms; Memory: 10MB
Comment #5
charchil khandelwal commentedComment #6
samitk commentedHi @Charchil Khandelwal,
I checked
rsg.info.ymlfile, The project, datestamp, version keys are not there. Please check belowLooks like you download that module with composer or manually. Please download it with git by following command, than try that patch.
git clone https://git.drupalcode.org/project/rsg.gitComment #7
rishu_kumar commentedI will review it.
Comment #8
rishu_kumar commentedWhen I apply #2 patch.Patch apply cleanly.
I attached screenshot for Reference.
It can be moved to RTBC.
Thanks
Comment #9
Sonal Gyanani commentedComment #11
Sonal Gyanani commentedPatch #2 applied cleanly, all errors and warnings are fixed.
Moving it to RTBC.
Thanks
Comment #12
praveen3555 commentedComment #14
praveen3555 commented