From cce24b40787a3d0aabbadeae664d03c3f814e259 Mon Sep 17 00:00:00 2001 From: Thalia Date: Wed, 27 Mar 2019 16:36:30 +0000 Subject: [PATCH] Deprecate Block::isValid method Block::isValid checks whether the block target equals null. It seems to have been unused since commit 40a926ab2c566052eefd08c36f246d6b5321afc5. It was called from Block::newFromDB, which was removed in favour of Block::newFromTarget, which has its own logic for checking the target. Since the method is public, it should be deprecated before removal. Change-Id: Ibcfb377a382f55e80933836960be7e3589908390 --- RELEASE-NOTES-1.33 | 1 + includes/Block.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index 72a468b0a0..a93cd3d268 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -404,6 +404,7 @@ because of Phabricator reports. * ManualLogEntry::setTags() is deprecated, use ManualLogEntry::addTags() instead. The setTags() method was overriding the tags, addTags() doesn't override, only adds new tags. +* Block::isValid is deprecated, since it is no longer needed in core. === Other changes in 1.33 === * (T201747) Html::openElement() warns if given an element name with a space diff --git a/includes/Block.php b/includes/Block.php index 060eebd703..46e8124c01 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -964,9 +964,12 @@ class Block { /** * Is the block address valid (i.e. not a null string?) + * + * @deprecated since 1.33 No longer needed in core. * @return bool */ public function isValid() { + wfDeprecated( __METHOD__, '1.33' ); return $this->getTarget() != null; } -- 2.20.1