From dda1696b7ffab626ca5a0ca6f3d85a968317dc7b Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Mon, 16 Mar 2015 00:30:41 -0700 Subject: [PATCH] Remove unused "swap" global function Deprecated in 26e1e083e8bfd4, unused since r12411. Change-Id: If328f09114ac5a5d23a300d9b0bbcd7d67e051c8 --- RELEASE-NOTES-1.25 | 1 + includes/GlobalFunctions.php | 14 -------------- .../includes/GlobalFunctions/GlobalTest.php | 18 ------------------ 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 4612c4519f..5f0b8aa7f8 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -429,6 +429,7 @@ changes to languages because of Bugzilla reports. * All BloomCache related code has been removed. This was largely experimental. * $wgResourceModuleSkinStyles no longer supports per-module local or remote paths. They can only be set for the entire skin. +* Removed global function swap(). (deprecated since 1.24) == Compatibility == diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3be43b39cc..9e81a3c1c0 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2473,20 +2473,6 @@ function wfIsHHVM() { return defined( 'HHVM_VERSION' ); } -/** - * 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; -} - /** * Tries to get the system directory for temporary files. First * $wgTmpDirectory is checked, and then the TMPDIR, TMP, and TEMP diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index dcafb73954..1e30273e9c 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -374,24 +374,6 @@ class GlobalTest extends MediaWikiTestCase { } } - /** - * @covers ::swap - */ - public function testSwapVarsTest() { - $this->hideDeprecated( 'swap' ); - - $var1 = 1; - $var2 = 2; - - $this->assertEquals( $var1, 1, 'var1 is set originally' ); - $this->assertEquals( $var2, 2, 'var1 is set originally' ); - - swap( $var1, $var2 ); - - $this->assertEquals( $var1, 2, 'var1 is swapped' ); - $this->assertEquals( $var2, 1, 'var2 is swapped' ); - } - /** * @covers ::wfPercent */ -- 2.20.1