Problem/Motivation
Services should not keep the container. This refactors two scenarios where that occurs.
Steps to reproduce
Proposed resolution
The Executor uses the Factory directly to pass on the dependencies, rather than delegating this, which allows removing the create method.
For the PasswordReset data producer a test is written to document the current behaviour. Then the controller instantiation from the container is moved to a HTTP sub-request that calls the controller directly. This allows injecting the HTTP kernel rather than the entire container.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork graphql-3587709
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
kingdutchComment #4
kingdutchComment #5
klausiThanks, approach looks good to me. Just minor comments.
Comment #6
kingdutchI rebased the work to fix the comment about the container, that was part of the other issue that's now merged.
I've added a type intersection (supported in PHP 8.1) to indicate MailManager is a MockObject which should satisfy PHPStan in the test :) That should've addressed all comments.
Comment #7
kingdutch