From a2d84745d2ea10a67cb78494d20e0bd6d514b1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 14 Mar 2014 07:29:15 +0100 Subject: [PATCH] Drop List::getSingleItem as it is not used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- libraries/List.class.php | 14 -------------- test/classes/PMA_List_Database_test.php | 11 ----------- 2 files changed, 25 deletions(-) diff --git a/libraries/List.class.php b/libraries/List.class.php index 3440e1be51..c04832285c 100644 --- a/libraries/List.class.php +++ b/libraries/List.class.php @@ -41,20 +41,6 @@ abstract class PMA_List extends ArrayObject parent::__construct($array, $flags, $iterator_class); } - /** - * returns item only if there is only one in the list - * - * @return PMA_List single item - */ - public function getSingleItem() - { - if (count($this) === 1) { - return reset($this); - } - - return $this->getEmpty(); - } - /** * defines what is an empty item (0, '', false or null) * diff --git a/test/classes/PMA_List_Database_test.php b/test/classes/PMA_List_Database_test.php index 2fa6f2b12b..17d0b794fc 100644 --- a/test/classes/PMA_List_Database_test.php +++ b/test/classes/PMA_List_Database_test.php @@ -58,17 +58,6 @@ class PMA_List_Database_Test extends PHPUnit_Framework_TestCase $this->assertEquals('', $arr->getEmpty()); } - /** - * Test for PMA_List_Database::getSingleItem - * - * @return void - */ - public function testSingle() - { - $arr = new PMA_List_Database; - $this->assertEquals('single_db', $arr->getSingleItem()); - } - /** * Test for PMA_List_Database::exists *