Until MediaWiki 1.45, AutopromoteConditionHook accepted any datatype as the condition type and had a doc comment saying that it should be a string. I practice, strings and ints were passed. Given that we'd like to actually specify type hints on UserRequirementsConditionHook and UserRequirementsConditionDisplayHook, the practice should be reconciled into one of two options:
- Specify string|int as parameter type in the hooks. Extensions would require no changes to adapt.
- Convert condition type to string and then have only string as accepted parameter type. Extensions would need to adjust the type of the value they compare to.
The first option will sanction the current state of passing strings or ints to the hooks, unlike specified in the documentation for AutopromoteConditionHook. This will be the option to go.
Acceptance criteria
- UserRequirementsConditionHook and UserRequirementsConditionDisplayHook define the parameters as string|int
- FlaggedRevs is updated to have string|int type specified
- CentralAuth is updated to have string|int type specified
- OATHAuth is updated to have string|int type specified
- TorBlock is updated to have string|int type specified