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

CommentFileSizeAuthor
#4 CodStn-3331904-4.patch1.15 KBamit.rawat777
#2 3331904-2.patch3.5 KBsamitk
Command icon 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

samit.310@gmail.com created an issue. See original summary.

samitk’s picture

Assigned: samitk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.5 KB

Error/warnings are fixed.

Status: Needs review » Needs work

The last submitted patch, 2: 3331904-2.patch, failed testing. View results

amit.rawat777’s picture

Status: Needs work » Needs review
StatusFileSize
new1.15 KB

I have fixed some issues.

Sonal Gyanani made their first commit to this issue’s fork.

Sonal Gyanani’s picture

Status: Needs review » Reviewed & tested by the community

Patch #2 works fine and all errors and warnings are fixed.
Patch #4 still shows errors and warnings.
So moving it to RTBC

jeroent made their first commit to this issue’s fork.

jeroent’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix quality checks
Issue tags: -, -

jeroent’s picture

Status: Reviewed & tested by the community » Fixed

Meged to 2.0.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.