FILE: D:\xampp\htdocs\drupal9.5\web\modules\contrib\grid_widget\src\Plugin\Field\FieldWidget\OptionsGridWidget.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
42 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | php-drupal-coding-standard-3295428-5.patch | 3.64 KB | akshaydalvi212 |
| #4 | Screenshot from 2022-07-12 13-01-08.png | 50.69 KB | akshaydalvi212 |
| #2 | calls-should-be-avoid-3295428-2.patch | 1.51 KB | Harsh panchal |
Comments
Comment #2
Harsh panchal commentedI have fixed this issue and providing a patch.
Comment #3
akshaydalvi212 commentedHello @Harsh panchal,
I will review this patch.
Thanks and regards.
Comment #4
akshaydalvi212 commentedHello @Harsh panchal,
After applying the patch getting an error and warning as shown below:

I will provide an updated patch to solve the remaining error and warnings.
Thanks and regards.
Comment #5
akshaydalvi212 commentedHello all,
Providing the updated patch for eliminating the remaining warnings.
kindly review it and provide your feedback on the same.
Thanks & regards.
Comment #6
atul_ghate commentedHello @akshay
I will review this patch.
Comment #7
littlecodingLimit the scope of changes included in the patch to the correct use of StringTranslationTrait that is inherited from the PluginBase.
Comment #9
littlecoding