Commit graph

14 commits

Author SHA1 Message Date
Matěj Suchánek 89c61833c2 Migrate to new phan
Bug: T216908
Change-Id: I28faf3638dfbc20b84ba78d476b02f7bbc8cbd6a
2019-03-17 21:25:03 +01:00
Kunal Mehta 71ee586108 Avoid use of func_get_args()
Change-Id: I7854d2005aefd581959c2cd292928900c047203c
2019-03-08 13:03:38 -08:00
Fomafix c993bb8353 Fix findings by phpcs
* Add @inheritDoc to functions that are inheritance.
* Move comments to a single line.

Remove the phpcs rule exceptions:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I742ee19f0a3d2d62e08b6f2e35cd9a6b3940cd22
2019-02-06 18:03:50 +00:00
Fomafix 9f12acd962 Remove "return true" on hook handler functions
Before MediaWiki 1.23, returning true was required. Since 1.23 this not
needed anymore.

Change-Id: Iae9bcf416d851af2a8703fd76dc13d0b1d2db8bc
2019-02-06 18:03:15 +00:00
Fomafix b3ac7f5404 Add typehints to function parameters
* Add "= null" when null is supported and used.
* Also fix Doxygen tags.

Change-Id: I209b23eee54b5e8e0f4091f3d4cd7c5e44dbaff0
2019-02-05 15:30:31 +01:00
Fomafix 27289b479d Change hooks to explicitly load the modules
This change adds the needed modules to the page in the same hook
that adds the category tree HTML.

This avoids loading the modules on skins without a sidebar, like
SkinApi, or on pages without categories.

A forced-loading of the modules from BeforePageDisplay hook is not
necessary anymore in those cases.

This change avoids getting the OutputPage object from the global $wgOut.

Bug: T212820
Change-Id: I2bd50c45aa201a06630af3d57c9bcfccf7b22b99
2019-01-22 15:31:47 -08:00
Fomafix e31ac9cc84 Use hook SkinBuildSidebar instead of SkinTemplateOutputPageBeforeExec
This change allows the skin to customize if there is a sidebar or not.
For example the SkinApi overloads buildSidebar and therefor the hook
SkinBuildSidebar is not triggered.

Change-Id: Ib39736901f25822d40265ccaa5fd0feea977cdc1
2019-01-22 23:15:07 +00:00
Fomafix 095040a9e6 Remove hook SkinJoinCategoryLinks
The hook `SkinJoinCategoryLinks` is not used and not triggered.

Also remove the style for the class CategoryTreeCategoryBarItem because
it is only used in skinJoinCategoryLinks::skinJoinCategoryLinks.

Change-Id: I52e4f819ff195fc1fa8a148b0bb58d95a4bf22d7
2019-01-10 20:15:28 +01:00
libraryupgrader 64312796a0 build: Updating mediawiki/mediawiki-codesniffer to 20.0.0
Change-Id: I3dc05f3935b2f952182c3afbfc05d7e6c5557039
2018-05-26 01:01:12 +00:00
Kunal Mehta 50c10d1fcb Use standard GPL file header
Change-Id: Ic49d45d0a0cb640d40486735c95f13cc6e29063f
2018-04-16 22:38:06 +00:00
Kunal Mehta d85ca412b7 Don't conditionally register any hooks
Register all hooks unconditionally in extension.json, and then in the
hook
itself, check whether they should be doing anything.

Change-Id: I5f0019fc444371a24a11a25ca2d980c0a9ab5a61
2018-04-16 18:05:06 +00:00
libraryupgrader 5a7ebcfead build: Updating mediawiki/mediawiki-codesniffer to 18.0.0
The following sniffs now pass and were enabled:
* MediaWiki.Commenting.LicenseComment.InvalidLicenseTag

Change-Id: I13c4825186d8ba101feb2a2d28ee8dc9bc7306dd
2018-04-13 22:19:35 +00:00
Timo Tijhof 38babc1011 Set visibility of CategoryTree::encodeOptions() as protected
Not referenced anywhere in Wikimedia Git, except for the one
method that uses it, in the same class here.

Also:
* Set explicit 'public' visibility of getOptionsAsJsStructure().
* Avoid use of !is_null().
* Avoid assignment in ternary.

Change-Id: I71d2a247e001b7f7f4f52546e8167a79d873076e
2018-02-16 19:30:51 -08:00
Kunal Mehta 8e51ea4e3a Move classes into includes/
Change-Id: I308523aa764594798d72974fb79e19aef6c3f342
2018-02-08 22:23:07 -08:00
Renamed from CategoryTree.hooks.php (Browse further)