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->messengerthat 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
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 #3
benstallings commentedComment #5
jproctorThe 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$settingsinstead.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.
Comment #6
jproctorMerged.
Thanks again for your work on cleaning up the codebase, @benstallings!