From: Umherirrender Date: Wed, 22 Aug 2018 13:41:49 +0000 (+0200) Subject: Replace some wfMessage by ContextSource::msg X-Git-Tag: 1.34.0-rc.0~4318^2 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=7f68979bec7abc945e1131aec29a90838eafe077;p=lhc%2Fweb%2Fwiklou.git Replace some wfMessage by ContextSource::msg Change-Id: Ie056af7a002dbbf4e8defc8032bfcc0bdefc6566 --- diff --git a/.phpcs.xml b/.phpcs.xml index 10394d31cd..65ddb73393 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -16,7 +16,6 @@ - diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index acf6fcb9fc..9817c3fc4f 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -296,6 +296,7 @@ class DerivativeContext extends ContextSource implements MutableContext { public function msg( $key ) { $args = func_get_args(); + // phpcs:ignore MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage return wfMessage( ...$args )->setContext( $this ); } } diff --git a/includes/pager/IndexPager.php b/includes/pager/IndexPager.php index b00ec3a893..7ce125de1b 100644 --- a/includes/pager/IndexPager.php +++ b/includes/pager/IndexPager.php @@ -472,7 +472,7 @@ abstract class IndexPager extends ContextSource implements Pager { } if ( in_array( $type, [ 'asc', 'desc' ] ) ) { - $attrs['title'] = wfMessage( $type == 'asc' ? 'sort-ascending' : 'sort-descending' )->text(); + $attrs['title'] = $this->msg( $type == 'asc' ? 'sort-ascending' : 'sort-descending' )->text(); } if ( $type ) { diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index c603f2f3f3..b05fb0bcd9 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -533,7 +533,7 @@ abstract class Skin extends ContextSource { $t = $embed . implode( "{$pop}{$embed}", $allCats['normal'] ) . $pop; $msg = $this->msg( 'pagecategories' )->numParams( count( $allCats['normal'] ) )->escaped(); - $linkPage = wfMessage( 'pagecategorieslink' )->inContentLanguage()->text(); + $linkPage = $this->msg( 'pagecategorieslink' )->inContentLanguage()->text(); $title = Title::newFromText( $linkPage ); $link = $title ? Linker::link( $title, $msg ) : $msg; $s .= '