From 944bbfe0561bfbb22fb4c4a5334fa0fedd4640b7 Mon Sep 17 00:00:00 2001 From: Thalia Date: Tue, 7 May 2019 09:46:44 -0500 Subject: [PATCH] Add AbstractBlock parent class for Block This anticipates I83bceb5e5, which refactors Block into different classes: Block (for blocks stored in the database), SystemBlock (for temporary blocks), and AbstractBlock (the parent class). Block should be become a deprecated alias of DatabaseBlock. This adds an empty AbstractBlock parent class, and makes Block extend AbstractBlock, but leaves it otherwise unchanged. This is to allow typehints to be updated, to avoid a breaking change. Bug: T222737 Change-Id: I3cf78cf77ccf492dadf53e479f81891961021469 --- includes/Block.php | 3 ++- includes/block/AbstractBlock.php | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 includes/block/AbstractBlock.php diff --git a/includes/Block.php b/includes/Block.php index 0d13f7d3a2..2479def7af 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -22,13 +22,14 @@ use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IDatabase; +use MediaWiki\Block\AbstractBlock; use MediaWiki\Block\BlockRestrictionStore; use MediaWiki\Block\Restriction\Restriction; use MediaWiki\Block\Restriction\NamespaceRestriction; use MediaWiki\Block\Restriction\PageRestriction; use MediaWiki\MediaWikiServices; -class Block { +class Block extends AbstractBlock { /** @var string */ public $mReason; diff --git a/includes/block/AbstractBlock.php b/includes/block/AbstractBlock.php new file mode 100644 index 0000000000..f432440874 --- /dev/null +++ b/includes/block/AbstractBlock.php @@ -0,0 +1,27 @@ +