const TOOL_LINKS_NOBLOCK = 1;
const TOOL_LINKS_EMAIL = 2;
- /**
- * Return the CSS colour of a known link
- *
- * @deprecated since 1.28, use LinkRenderer::getLinkClasses() instead
- *
- * @since 1.16.3
- * @param LinkTarget $t
- * @param int $threshold User defined threshold
- * @return string CSS class
- */
- public static function getLinkColour( LinkTarget $t, $threshold ) {
- wfDeprecated( __METHOD__, '1.28' );
- $services = MediaWikiServices::getInstance();
- $linkRenderer = $services->getLinkRenderer();
- if ( $threshold !== $linkRenderer->getStubThreshold() ) {
- // Need to create a new instance with the right stub threshold...
- $linkRenderer = $services->getLinkRendererFactory()->create();
- $linkRenderer->setStubThreshold( $threshold );
- }
-
- return $linkRenderer->getLinkClasses( $t );
- }
-
/**
* This function returns an HTML link to the given target. It serves a few
* purposes:
$res = null;
$dummy = new DummyLinker;
if ( !Hooks::run( 'ImageBeforeProduceHTML', [ &$dummy, &$title,
- &$file, &$frameParams, &$handlerParams, &$time, &$res ] ) ) {
+ &$file, &$frameParams, &$handlerParams, &$time, &$res,
+ $parser, &$query, &$widthOption
+ ] ) ) {
return $res;
}
}
// Clean up parameters
- $page = isset( $handlerParams['page'] ) ? $handlerParams['page'] : false;
+ $page = $handlerParams['page'] ?? false;
if ( !isset( $frameParams['align'] ) ) {
$frameParams['align'] = '';
}
$params = [
'alt' => $frameParams['alt'],
'title' => $frameParams['title'],
- 'valign' => isset( $frameParams['valign'] ) ? $frameParams['valign'] : false,
+ 'valign' => $frameParams['valign'] ?? false,
'img-class' => $frameParams['class'] ];
if ( isset( $frameParams['border'] ) ) {
$params['img-class'] .= ( $params['img-class'] !== '' ? ' ' : '' ) . 'thumbborder';
* @param string $manualthumb
* @return string
*/
- public static function makeThumbLinkObj( Title $title, $file, $label = '', $alt,
+ public static function makeThumbLinkObj( Title $title, $file, $label = '', $alt = '',
$align = 'right', $params = [], $framed = false, $manualthumb = ""
) {
$frameParams = [
) {
$exists = $file && $file->exists();
- $page = isset( $handlerParams['page'] ) ? $handlerParams['page'] : false;
+ $page = $handlerParams['page'] ?? false;
if ( !isset( $frameParams['align'] ) ) {
$frameParams['align'] = 'right';
}
$key = strtolower( $name );
}
- return self::linkKnown( SpecialPage::getTitleFor( $name ), wfMessage( $key )->text() );
+ return self::linkKnown( SpecialPage::getTitleFor( $name ), wfMessage( $key )->escaped() );
}
/**
* red if the user has no edits?
* @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK
* and Linker::TOOL_LINKS_EMAIL).
- * @param int $edits User edit count (optional, for performance)
+ * @param int|null $edits User edit count (optional, for performance)
* @return string HTML fragment
*/
public static function userToolLinks(
* @since 1.16.3
* @param int $userId User identifier
* @param string $userText User name or IP address
- * @param int $edits User edit count (optional, for performance)
+ * @param int|null $edits User edit count (optional, for performance)
* @return string
*/
public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
* @todo FIXME: Doesn't handle sub-links as in image thumb texts like the main parser
*
* @param string $comment Text to format links in. WARNING! Since the output of this
- * function is html, $comment must be sanitized for use as html. You probably want
- * to pass $comment through Sanitizer::escapeHtmlAllowEntities() before calling
- * this function.
+ * function is html, $comment must be sanitized for use as html. You probably want
+ * to pass $comment through Sanitizer::escapeHtmlAllowEntities() before calling
+ * this function.
* @param Title|null $title An optional title object used to links to sections
* @param bool $local Whether section links should refer to local page
* @param string|null $wikiId Id of the wiki to link to (if not the local wiki),
* @since 1.16.3. $context added in 1.20. $options added in 1.21
*
* @param Revision $rev
- * @param IContextSource $context Context to use or null for the main context.
+ * @param IContextSource|null $context Context to use or null for the main context.
* @param array $options
* @return string
*/