Commit graph

12 commits

Author SHA1 Message Date
Kunal Mehta
03e7ae45bc Remove deprecated Linker::getLinkColour()
Change-Id: I1818d9eb369c620cc436c13446a5362816e8362d
2018-06-13 01:30:04 -07:00
Erik Bernhardson
3a565d6b17 Resolve required parameter after optional parameter in Linker
Change-Id: I2569e30922e93404a59fa282df8ae8d3d19912fd
2018-06-08 21:49:04 +00:00
awu42
fa8ae38943 Removed deprecated Linker functions
Removed:
 - getInterwikiLinkAttributes (deprecated in 1.25)
 - getInternalLinkAttributes (deprecated in 1.25)
 - getInternalLinkAttributesObj (deprecated in 1.25)
 - getLinkAttributesInternal (deprecated in 1.25)
 - usages in includes/DummyLinker.php

Bug: T61113
Change-Id: I98182f4145dafdc6e60953f25a5f20575257a854
2017-01-07 15:33:33 +00:00
jenkins-bot
e5999cc51d Merge "Linker: Deprecate formatSize()" 2016-09-15 20:18:46 +00:00
Kunal Mehta
b6ac6ab899 Linker: Deprecate formatSize()
This is a static function that uses global state through $wgLang, and
provides no benefit than calling Language::formatSize() directly aside
from escaping. But that should generally be handled closer to output
generation.

Change-Id: I35fdbaf2fcaa89f0d4442e1f63ec8ed29e0c339f
2016-09-10 00:14:20 -07:00
Kunal Mehta
b16f897a05 Move Linker::formatTemplates() to separate class, remove global usage
Linker::formatTemplates() was a static function that depended upon
global state like $wgLang (explicitly), $wgUser & $wgTitle (implicitly).
Moving it to a separate class allows us to clean it up a little bit and
use modern things like RequestContext and LinkRenderer.

Bug: T145177
Change-Id: Icdea8a2b299b4876feb3df3d66df3e4c104dd928
2016-09-08 22:56:57 -07:00
Kunal Mehta
5119236d4d Move Linker::getLinkColour() into LinkRenderer
* Rename to getLinkClasses() since it's not really returning colours,
  but CSS classes.
* Dependency inject LinkCache into LinkRenderer
* Update all callers of Linker::getLinkColour(), and mark it as
  deprecated (no other uses in Gerrit)
* Update a bunch of tests for new dependency

Change-Id: Id178e2dcc60b833ce2dbad4920896b93cabba1bf
2016-05-27 09:18:09 -07:00
Kunal Mehta
c66b6a1e43 Remove 'noclasses' from Linker::linkKnown() defaults
The intention for Linker::linkKnown() was to be used when the caller had
already preloaded the target's existence ('known') and called
Linker::getLinkColour() directly ('noclasses'). However, nearly all
usage of linkKnown() only did the first part, and not the latter.

So do what people actually ended up using the function for, and remove
'noclasses' from the default parameters. As long as the target the link
is being created for is already in LinkCache, this shouldn't cause any
extra database queries.

Change-Id: Ia5a4c2f18ec780627146617a1498bd04fcfbb3ee
2016-05-19 19:07:58 -07:00
Paladox
6164423de0 Update mediawiki/mediawiki-codesniffer to 0.7.1
This also fixes some code style errors.

This also include a performance increase in running phpcs, performance
increase was done by addshore :).

Change-Id: I74a3d3134791ac22c332bb4fa0bc5c3662599394
2016-05-07 07:24:04 +00:00
addshore
9c948bb396 Deprecated 3 methods in DummyLinker
These methods are already deprecated in
Linker but they should also warn with the
method in DummyLinker

Change-Id: I41f0ee5b37f8a92711d1396b8b40d5235b643238
2016-04-20 09:08:25 +01:00
addshore
384f1a18c2 Unroll DummyLinker::__call
Change-Id: Ie1325c2b8f06f9936e7b7ad10780c4b0cf702d18
2016-04-20 08:54:42 +01:00
addshore
b215e34de8 Move DummyLinker to own file
Change-Id: I1808a6b77af2597b4dd2c9f1e0c8604c2bc8c801
2016-04-20 08:48:48 +01:00