Page MenuHomePhabricator

Type hint $updater parameter in onLoadExtensionSchemaUpdates hooks
Open, Needs TriagePublic

Description

Task for all other extensions, as done for Wikimedia-deployed extensions in T223939

Code search: https://codesearch.wmflabs.org/search/?q=onLoadExtensionSchemaUpdates%5C(%20%5C%24&i=nope&files=&repos=

Example patch: https://gerrit.wikimedia.org/r/#/c/511602/

Also

All extensions with unknown name of hook functions
https://codesearch.wmflabs.org/search/?q=function%5Cs%2B%5Cw%2B%5Cs*%5C(%20%5C%24updater&i=nope&files=&repos=
Remove also = null and return true for such hook functions

Event Timeline

@Ammarpad: Hi, do you plan to mentor this in Google-Code-in-2019, or do you have any mentors in mind? How much work would a student have to perform for one GCI task?

@Ammarpad: Hi, do you plan to mentor this in Google-Code-in-2019, or do you have any mentors in mind?

Yes I will mentor that for few tasks like 3-5. I am planning to create a subtask for each extension.

How much work would a student have to perform for one GCI task?

The work is not much, on most extensions it's just changing ( $updater ) to ( DatabaseUpdater $updater )

Change 561325 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/SpamRegex@master] Type hint $updater parameter in onLoadExtensionSchemaUpdates

https://gerrit.wikimedia.org/r/561325

Ammarpad: I'd like to co-mentor this task, is that ok for you?

Ammarpad: I'd like to co-mentor this task, is that ok for you?

Yes, Really.

Change 561325 merged by jenkins-bot:
[mediawiki/extensions/SpamRegex@master] Type hint $updater parameter in onLoadExtensionSchemaUpdates

https://gerrit.wikimedia.org/r/561325

Change 687749 had a related patch set uploaded (by Sahilgrewalhere; author: Sahilgrewalhere):

[mediawiki/extensions/MathSearch@master] classes: Type hint `$updater` parameter in onLoadExtensionSchemaUpdates

https://gerrit.wikimedia.org/r/687749

Change 687749 merged by jenkins-bot:

[mediawiki/extensions/MathSearch@master] classes: Type hint `$updater` parameter in onLoadExtensionSchemaUpdates

https://gerrit.wikimedia.org/r/687749

Change 688244 had a related patch set uploaded (by Sahilgrewalhere; author: Sahilgrewalhere):

[mediawiki/extensions/examples@master] classes: Type hint `$updater` parameter in onLoadExtensionSchemaUpdates

https://gerrit.wikimedia.org/r/688244

It is not possible to set a type hint when the new hook handler system is used and the interface MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook is implemented, because the interface does not contains the type hint.