A best practices check on the module suggests using dependency injection instead of global getters within the Authmap service and the redirect controller:

FILE: openid_connect/src/Authmap.php
--------------------------------------------------------------------------
 88 | WARNING | User::load calls should be avoided in classes, use
    |         | dependency injection instead
--------------------------------------------------------------------------

FILE: openid_connect/src/Controller/RedirectController.php
--------------------------------------------------------------------------
 172 | WARNING | \Drupal calls should be avoided in classes, use
     |         | dependency injection instead
--------------------------------------------------------------------------
CommentFileSizeAuthor
#2 openid_connect-2960884.patch3.35 KBmario steinitz

Comments

Mario Steinitz created an issue. See original summary.

mario steinitz’s picture

Assigned: mario steinitz » Unassigned
Status: Active » Needs review
StatusFileSize
new3.35 KB

This patch fixes the suggested use of dependency injection.

  • Mario Steinitz committed 7cf239e on 8.x-1.x
    Issue #2960884 by Mario Steinitz: Use dependency injection instead of...
mario steinitz’s picture

Status: Needs review » Fixed
sun’s picture

Title: Use dependency injection instead of global getters » HEAD BROKEN: Use dependency injection instead of global getters
Priority: Normal » Critical
Status: Fixed » Needs work

This commit broke authorize() as you forgot to inject a config service into the redirect controller.

sun’s picture

Status: Needs work » Active
hirvinen’s picture

Status: Active » Fixed

OpenIDRedirectController inherits Drupal\Core\Controller\ControllerBase::config so there is no need to inject another config factory.

Status: Fixed » Closed (fixed)

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

jcnventura’s picture

Title: HEAD BROKEN: Use dependency injection instead of global getters » Use dependency injection instead of global getters
Priority: Critical » Normal
Status: Closed (fixed) » Closed (works as designed)

Just setting back the title to reflect the real status.