Problem/Motivation

Postponed on #3620912: Deprecate user.module cancel methods

From godotislate:

This can be a closure, since it's only used in one method and not relevant to the large majority of requests.
I missed seeing the same thing for the login/logout finalizers, so we can do those two and accountCancellation all as a follow up. The form class properties are fine as is, because theoretically forms can be serialized, so we can't have closure properties.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3621541

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

nicxvan created an issue. See original summary.

danielveza’s picture

Title: [pp-1] Create closure properties for UserController » Create closure properties for UserController

Parent ticket is merged, so this is unpostponed

longwave’s picture

If we did #3398528: Add support for autowiring to controller methods then you could inject services into only the methods that need them instead of the whole class; this would make fat controllers more manageable.

danielveza’s picture

Status: Active » Needs review

Pushed up the initial work for this. Followed the existing patterns on core.

The only thing that was missing is that because this isn't a service, I had to setup the closures in ::create, I think this is the first instance of that. Claude helped with that part.

EDIT: Ah I still had the same window opened from my last comment, so I didn't see @longwaves comment in the middle. Should we still do this?

longwave’s picture

Might be worth starting from the MR in #3 and then seeing how much we could thin down the UserController constructor.