Problem/Motivation
FILE: /var/www/html/drupal9/web/modules/contrib/image_field_caption/src/ImageCaptionItem.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | Doc comment is empty
40 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
42 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
48 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | phpcs-issue-fixes-3333247-6.patch | 24.21 KB | istryker |
| #5 | after patch.png | 128.8 KB | paraderojether |
| #5 | before patch.png | 286.63 KB | paraderojether |
| #4 | phpcs-issue-fixes-3333247-4.patch | 24.34 KB | ashutosh ahirwal |
| #2 | t()_calls_should_be_avoided-3333247-2.patch | 10.32 KB | yashmalviya |
Comments
Comment #2
yashmalviya commentedI have fixed the issue . Please review it
Comment #3
stefank commentedHi @yashmalviya ,
As this is mainly ok, I would suggest to change the issue title and description to fix Drupal coding standards and it should then cover all the files in the module/project. Or, you change only the relevant code which the title is suggesting.
Thanks
Comment #4
ashutosh ahirwal commentedHi I have changed the title of this issue and also performed the issue fixes which was rised by below command.
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml web/modules/custom/image_field_caption
Providing patch with phpcs-issue-fixes.
Comment #5
paraderojether commentedHi @Ashutosh Ahirwal
I reviewed patch 4, applied it against Image Field Caption 8.x-1.2, and confirmed it fixes the errors/warnings that is reported by phpcs.
I added screenshots for reference.
Thank You.
Comment #6
istryker commentedReroll due to other patches being applied.
Comment #8
istryker commentedCommitted