aboutsummaryrefslogtreecommitdiffstats
path: root/includes/changes
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2021-08-31 00:16:19 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2021-09-03 23:03:24 +0200
commite29cd309d1e0d3e82c5bdb33704b291009b62260 (patch)
tree3c7cd8e9fd3b7a9ef7cf97c13d7cfa85e5240d41 /includes/changes
parentc1f905cbe773c3891d40f39bb788cdaa51737a70 (diff)
downloadmediawikicore-e29cd309d1e0d3e82c5bdb33704b291009b62260.tar.gz
mediawikicore-e29cd309d1e0d3e82c5bdb33704b291009b62260.zip
changes: Remove ChangesList->skin
Each Skin is a IContextSource, which makes the instanceof checks in the constructor not needed Change-Id: Ie44ee72c70956da5f82cd6b562e527a485030b51
Diffstat (limited to 'includes/changes')
-rw-r--r--includes/changes/ChangesList.php17
-rw-r--r--includes/changes/EnhancedChangesList.php16
2 files changed, 5 insertions, 28 deletions
diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index 84ed772b8a35..8b1857df63d9 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -37,11 +37,6 @@ class ChangesList extends ContextSource {
public const CSS_CLASS_PREFIX = 'mw-changeslist-';
- /**
- * @var Skin
- */
- public $skin;
-
protected $watchlist = false;
protected $lastdate;
protected $message;
@@ -67,17 +62,11 @@ class ChangesList extends ContextSource {
protected $filterGroups;
/**
- * @param Skin|IContextSource $obj
+ * @param IContextSource $context
* @param ChangesListFilterGroup[] $filterGroups Array of ChangesListFilterGroup objects (currently optional)
*/
- public function __construct( $obj, array $filterGroups = [] ) {
- if ( $obj instanceof IContextSource ) {
- $this->setContext( $obj );
- $this->skin = $obj->getSkin();
- } else {
- $this->setContext( $obj->getContext() );
- $this->skin = $obj;
- }
+ public function __construct( $context, array $filterGroups = [] ) {
+ $this->setContext( $context );
$this->preCacheMessages();
$this->watchMsgCache = new MapCacheLRU( 50 );
$this->linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php
index a394fcd6849f..15538b1e74c0 100644
--- a/includes/changes/EnhancedChangesList.php
+++ b/includes/changes/EnhancedChangesList.php
@@ -41,23 +41,11 @@ class EnhancedChangesList extends ChangesList {
protected $templateParser;
/**
- * @param IContextSource|Skin $obj
+ * @param IContextSource $context
* @param ChangesListFilterGroup[] $filterGroups Array of ChangesListFilterGroup objects (currently optional)
* @throws MWException
*/
- public function __construct( $obj, array $filterGroups = [] ) {
- if ( $obj instanceof Skin ) {
- // @todo: deprecate constructing with Skin
- $context = $obj->getContext();
- } else {
- if ( !$obj instanceof IContextSource ) {
- throw new MWException( 'EnhancedChangesList must be constructed with a '
- . 'context source or skin.' );
- }
-
- $context = $obj;
- }
-
+ public function __construct( $context, array $filterGroups = [] ) {
parent::__construct( $context, $filterGroups );
// message is set by the parent ChangesList class