Filing a task retroactively since the first attempt failed and we've identified some prep work that seems worth tracking here for easy reference.
Prior work in 2022 before this task was filed:
* {3fdfef96e4ee} <https://gerrit.wikimedia.org/r/737160>
* {d7beb0e4ec7} <https://gerrit.wikimedia.org/r/808230>
* {d4ce0f3255ad} <https://gerrit.wikimedia.org/r/810976> - reverted due to the warning (correctly) identifying a violation in VisualEditor, as reported in {T312838}
Prior ideas in 2020:
>>! In {T249265} at T249265#6025206, @Pchelolo wrote:
> […]
>
>**Plan**
>
> I have made an overview of all the Action::getName overrides, and all of them are returning the same key the action is registered under.
>
> One exception is SpecialPageAction, however the modifications it does were added as a workaround to support IE6 in T22966, thus it can be removed now. Flow overrides action to return a private field set in constructor, but that's just to support make it simpler to override different flow actions.
>
> The action itself needs to know it's name sometimes, most heavily used in FormAction::getForm.
>
> Proposal:
> - Remove workaround for T22966 from Action::getActionName and SpecialPageAction::getName
> - Under the Stable interface policy make Action non-newable, thus deprecate and remove access to the constructor from anything except subclasses
> - Modify Action constructor signature to `__construct( string $name, Article $article )` - note that we drop the context, since Article should already hold the context. This is not a part of this issue, but since we would be deprecating the constructor signature, we might as well do this. Have b/c support for old signature, deprecate it.
> - Store the $name into a private field in the class, make Action::getName non-abstract, return the name passed in the constructor. Deprecate Action::getName for overriding in subclasses
> - Remove Action subclasses getName overrides
> - Make Action::getName final.