Problem/Motivation

phpstan reports,

------ ----------------------------------------------------------------------
Line src/Form/IdpDeleteForm.php
------ ----------------------------------------------------------------------
68 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/SAML/SamlSPAuth.php
------ ----------------------------------------------------------------------
101 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
108 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
132 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/SAML/SamlSPAuthnRequest.php
------ ----------------------------------------------------------------------
18 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/SAML/SamlSPSettings.php
------ ----------------------------------------------------------------------
45 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------

Steps to reproduce

see https://git.drupalcode.org/project/saml_sp/-/jobs/6337727

Proposed resolution

  • In IdpDeleteForm, use $this->messenger that comes with MessengerTrait..
  • In SamlSPAuth, use MessengerTrait and pass config in when instantiating the class in .module.
  • In SamlSPAuthnRequest, pass config in when instantiating the class in SamlSPAuth.
  • In SamlSPSettings, use MessengerTrait.

Remaining tasks

Make a MR.

Issue fork saml_sp-3547308

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

benstallings created an issue. See original summary.

benstallings’s picture

Assigned: benstallings » Unassigned
Status: Active » Needs review

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

jproctor’s picture

The Messenger changes are perfect. Thank you!

Something bugged me about the passing the config entity around and it took me a while to figure it out. We don’t need all of config, we were sharing it for exactly one key: debug. So I copied that into $settings instead.

I want these changes in the next release (see #3575005: Time to tag a 4.4.0 release), but I’m going to leave this issue in “Needs review” for a couple days to see if anyone other than me wants to test it.

jproctor’s picture

Status: Needs review » Fixed

Merged.

Thanks again for your work on cleaning up the codebase, @benstallings!

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.