Problem/Motivation
Getting following error/warnings
FILE: /app/modules/contrib/language_access/src/EventSubscriber/RouteSubscriber.php
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
41 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/language_access/src/LanguageAccessPermissions.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
50 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
Time: 4.64 secs; Memory: 10MB
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/language_access/
Proposed resolution
Above error/warnings need to be fixed
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | CodStn-3331904-4.patch | 1.15 KB | amit.rawat777 |
| #2 | 3331904-2.patch | 3.5 KB | samitk |
Issue fork language_access-3331904
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 commentedError/warnings are fixed.
Comment #4
amit.rawat777 commentedI have fixed some issues.
Comment #7
Sonal Gyanani commentedPatch #2 works fine and all errors and warnings are fixed.
Patch #4 still shows errors and warnings.
So moving it to RTBC
Comment #9
jeroentComment #11
jeroentMeged to 2.0.x. Thanks!