Found some coding standard issues.
FILE: /var/www/drupalvm/drupal/web/modules/contrib/autologout/tests/src/Functional/AutologoutTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 14 LINES
------------------------------------------------------------------------------------------------------------------------------------------
209 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
263 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
266 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
283 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
286 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
303 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
306 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
324 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
327 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
329 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
330 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
339 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
367 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
443 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/drupalvm/drupal/web/modules/contrib/autologout/src/AutologoutManager.php
-------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------
248 | WARNING | User::load calls should be avoided in classes, use dependency injection instead
295 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
298 | WARNING | User::load calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------
FILE: /var/www/drupalvm/drupal/web/modules/contrib/autologout/src/EventSubscriber/AutologoutSubscriber.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------
88 | ERROR | The $_GET super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->query->get('autologout_timeout') instead
88 | ERROR | The $_GET super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->query->get('autologout_timeout') instead
88 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request
| | instead
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/drupalvm/drupal/web/modules/contrib/autologout/src/Controller/AutologoutController.php
-----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
110 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3156418-13.patch | 853 bytes | Pooja Ganjage |
| #10 | 3156418-10.patch | 11.73 KB | ajits |
| #2 | 3156418-2.patch | 11.73 KB | kbrodej |
Comments
Comment #2
kbrodej commentedAttaching patch to solve these CS issues.
Comment #3
kbrodej commentedComment #4
Pooja Ganjage commentedHii,
While running module in local environment one error occurs that is
Declaration of Drupal\autologout\AutologoutManager::logoutRole($user) must be compatible with Drupal\autologout\AutologoutManagerInterface::logoutRole(Drupal\user\Entity\User $user)
So, solution for this need to provide User class argument into Drupal\autologout\AutologoutManager::logoutRole(User $user) in such way.
Thanks.
Comment #5
Pooja Ganjage commentedHii,
I am applying patch for whole coding standards and solution of what I faced issue in my previous comment #4.
Please review once and let me know.
Thanks.
Comment #6
Pooja Ganjage commentedComment #7
ajitsThe patch is not applicable and needs reroll.
Comment #8
shetpooja04 commentedRerolled the patch #5
Comment #10
ajitsApologies for not mentioning this before, but it seems like the scope of the issue was changed in comment #5 which tries to address the issue mentioned in comment #4.
This issue should be used to address the coding standard issues. For the other issue mentioned in #4 we are tracking that under #3121214: AutologoutManager class incompatible with interface and should be followed up there.
Re-uploading the patch from #2.
Comment #11
deaom commentedHi, phpcs does not return any errors/warnings after the patch is applies, so marking this as RTBC.
Comment #12
phthlaap commentedPlease help to commit patch to resolve this issue. I get this issue when I run PHPUnit for other feature in my local site.
Comment #13
Pooja Ganjage commentedHi,
I am applying patch for resolving issue as mentioned in #12 comment.
Review the patch once.
Thanks.
Comment #15
boshtian commented