Merge "GlobalFunctions: Deprecate swap()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 10 Jul 2014 00:50:28 +0000 (00:50 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 10 Jul 2014 00:50:28 +0000 (00:50 +0000)
includes/GlobalFunctions.php
tests/phpunit/includes/GlobalFunctions/GlobalTest.php

index c1908af..cb5b7fd 100644 (file)
@@ -2580,10 +2580,12 @@ function wfIsHHVM() {
 /**
  * Swap two variables
  *
+ * @deprecated since 1.24
  * @param mixed $x
  * @param mixed $y
  */
 function swap( &$x, &$y ) {
+       wfDeprecated( __FUNCTION__, '1.24' );
        $z = $x;
        $x = $y;
        $y = $z;
index 06b512d..91b531d 100644 (file)
@@ -369,6 +369,8 @@ class GlobalTest extends MediaWikiTestCase {
         * @covers ::swap
         */
        public function testSwapVarsTest() {
+               $this->hideDeprecated( 'swap' );
+
                $var1 = 1;
                $var2 = 2;