Improve documentation of the PageContentLanguage hook
authorNiklas Laxström <niklas.laxstrom@gmail.com>
Wed, 6 Mar 2019 12:23:06 +0000 (13:23 +0100)
committerNiklas Laxström <niklas.laxstrom@gmail.com>
Tue, 12 Mar 2019 07:05:59 +0000 (08:05 +0100)
commita08fc9eed6355976da7233dbf60b8f985ecd45ce
tree159a3b58650e7d013736d69846d9641056f8daae
parentae87a51b05b69c33cef363930f61121d9bb7820f
Improve documentation of the PageContentLanguage hook

Clarify that the type of second parameter that is being passed
to the hooks can be anything because one hook can change it and
then it is passed to another hook without the hook caller having
possibility to check or modify the value.

Clarify that hooks should only return Language objects.

Rename $wgLang to $userLang in the hook parameter documentation to
avoid false posivite matches for the global.

Fix some typos, use Title::inNamespace and add a test assertion.

Also, the $content parameter is unused by all implementations of
this method, and on quick look never passed by any caller. I kept
it for now, however.

Bug: T214358
Change-Id: Iae49d2998c2b762565d232c0337d84d43a4a900c
docs/hooks.txt
includes/content/ContentHandler.php
tests/phpunit/includes/content/ContentHandlerTest.php