Deprecate Block::isValid method
authorThalia <thalia.e.chan@googlemail.com>
Wed, 27 Mar 2019 16:36:30 +0000 (16:36 +0000)
committerThalia <thalia.e.chan@googlemail.com>
Wed, 27 Mar 2019 22:56:05 +0000 (22:56 +0000)
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
includes/Block.php

index 72a468b..a93cd3d 100644 (file)
@@ -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
index 060eebd..46e8124 100644 (file)
@@ -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;
        }