MWMessagePack: Deprecate MWMessagePack class and its method
authorDerick Alangi <alangiderick@gmail.com>
Sat, 20 Apr 2019 21:54:28 +0000 (22:54 +0100)
committerDerick Alangi <alangiderick@gmail.com>
Thu, 9 May 2019 21:40:03 +0000 (22:40 +0100)
Usage
=====

https://codesearch.wmflabs.org/search/?q=%5CbMWMessagePack%5Cb&i=nope&files=&repos=

Bug: T220313
Change-Id: I3648f8c14116f924d835f68077f46333d892a038

RELEASE-NOTES-1.34
includes/libs/MWMessagePack.php
tests/phpunit/includes/libs/MWMessagePackTest.php

index 5cb3dbe..786dae2 100644 (file)
@@ -177,6 +177,7 @@ because of Phabricator reports.
   deprecated. Use MediaWikiServices instead.
 * The getSubjectPage, getTalkPage, and getOtherPage of Title are deprecated.
   Use NamespaceInfo's getSubjectPage, getTalkPage, and getAssociatedPage.
+* MWMessagePack class, no longer used, has been deprecated in 1.34.
 
 === Other changes in 1.34 ===
 * …
index be7e93d..84b7b3e 100644 (file)
@@ -31,6 +31,7 @@
  *
  * @since 1.23
  * @file
+ * @deprecated since 1.34, no longer used
  */
 class MWMessagePack {
        /** @var bool|null Whether current system is bigendian. **/
@@ -43,11 +44,14 @@ class MWMessagePack {
         * (both indexed and associative) types. Object serialization is not
         * supported.
         *
+        * @deprecated since 1.34, no longer used
+        *
         * @param mixed $value
         * @return string
         * @throws InvalidArgumentException if $value is an unsupported type or too long a string
         */
        public static function pack( $value ) {
+               wfDeprecated( __METHOD__, '1.34' );
                if ( self::$bigendian === null ) {
                        self::$bigendian = pack( 'S', 1 ) === pack( 'n', 1 );
                }
index 695a734..3890cf8 100644 (file)
@@ -3,7 +3,7 @@
  * PHP Unit tests for MWMessagePack
  * @covers MWMessagePack
  */
-class MWMessagePackTest extends PHPUnit\Framework\TestCase {
+class MWMessagePackTest extends MediaWikiTestCase {
 
        use MediaWikiCoversValidator;
 
@@ -71,6 +71,7 @@ class MWMessagePackTest extends PHPUnit\Framework\TestCase {
         * @dataProvider providePacks
         */
        public function testPack( $type, $value, $expected ) {
+               $this->hideDeprecated( MWMessagePack::class . '::pack' );
                $actual = bin2hex( MWMessagePack::pack( $value ) );
                $this->assertEquals( $expected, $actual, $type );
        }