- Issue created by @donquixote
- Merge request !12077Draft: Resolve #3523124 "Drop method parameter from hook attributes" β (Open) created by donquixote
- π©πͺGermany donquixote
Link dependency issue.
Setting to "Needs review" to get some feedback.
Do not merge yet! - π©πͺGermany donquixote
I also wonder about the usefulness of `$module` parameter for Preprocess.
It will affect the order, and it can be used to make the implementation conditional on other modules.
But other than that? - πΊπΈUnited States dww
+1 from me. I canβt imagine wanting a separate class for each form ID you want to alter, and wanting an
__invoke()
method on each one.Removing this parameter, at least from
FormAlter
andPreprocess
, would also help minimize the yuckiness of π [pp-2] Clean up method default to use NULL for Hook Attributes Active . π - π¨π¦Canada Charlie ChX Negyesi πCanada
It is there because it is patterned after AsEventListener, the class level could already be deprecated and removed in 12 , it's not really needed.
- πΊπΈUnited States nicxvan
I think there is something to be said for keeping them close so it's easier to switch between a and I'm not sure it's that much more complex, but I don't have a super strong opinion on this.
- πΊπΈUnited States nicxvan
If we do remove this do we want to remove it from all hooks?
If I am being honest the only novel thing it provides is the ability to specify another class and method as the implementation, but I'm not sure why you'd need to do that.
As for the main reason is so you can place the attribute on the class, but then you have to have an __invoke method. Since we already have that restriction, why not drop method entirely, then if someone does not want a specially named class they use __invoke which already have to do.