From 5347fb02dca9f55d44392d15e1c1a020d5912240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 29 Sep 2022 15:15:20 +0200 Subject: [PATCH 1/2] Remove some constants and functions which have been long deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/ContactsManager.php | 18 ------------------ lib/public/Contacts/IManager.php | 9 --------- lib/public/Util.php | 21 --------------------- tests/lib/ContactsManagerTest.php | 2 +- 4 files changed, 1 insertion(+), 49 deletions(-) diff --git a/lib/private/ContactsManager.php b/lib/private/ContactsManager.php index 68783e3f79b..9853701a2eb 100644 --- a/lib/private/ContactsManager.php +++ b/lib/private/ContactsManager.php @@ -147,24 +147,6 @@ class ContactsManager implements IManager { unset($this->addressBooks[$addressBook->getKey()]); } - /** - * Return a list of the user's addressbooks display names - * ! The addressBook displayName are not unique, please use getUserAddressBooks - * - * @return IAddressBook[] - * @since 6.0.0 - * @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead - */ - public function getAddressBooks() { - $this->loadAddressBooks(); - $result = []; - foreach ($this->addressBooks as $addressBook) { - $result[$addressBook->getKey()] = $addressBook->getDisplayName(); - } - - return $result; - } - /** * Return a list of the user's addressbooks * diff --git a/lib/public/Contacts/IManager.php b/lib/public/Contacts/IManager.php index 65be12c4c39..ce50f8d5b32 100644 --- a/lib/public/Contacts/IManager.php +++ b/lib/public/Contacts/IManager.php @@ -159,15 +159,6 @@ interface IManager { */ public function register(\Closure $callable); - /** - * Return a list of the user's addressbooks display names - * - * @return array - * @since 6.0.0 - * @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead - */ - public function getAddressBooks(); - /** * Return a list of the user's addressbooks * diff --git a/lib/public/Util.php b/lib/public/Util.php index 6cd3eaa7f85..1289f8ccff4 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -56,27 +56,6 @@ use bantu\IniGetWrapper\IniGetWrapper; * @since 4.0.0 */ class Util { - /** - * @deprecated 14.0.0 use \OCP\ILogger::DEBUG - */ - public const DEBUG = 0; - /** - * @deprecated 14.0.0 use \OCP\ILogger::INFO - */ - public const INFO = 1; - /** - * @deprecated 14.0.0 use \OCP\ILogger::WARN - */ - public const WARN = 2; - /** - * @deprecated 14.0.0 use \OCP\ILogger::ERROR - */ - public const ERROR = 3; - /** - * @deprecated 14.0.0 use \OCP\ILogger::FATAL - */ - public const FATAL = 4; - /** @var \OCP\Share\IManager */ private static $shareManager; diff --git a/tests/lib/ContactsManagerTest.php b/tests/lib/ContactsManagerTest.php index 70e8dd74a1e..bc822214f26 100644 --- a/tests/lib/ContactsManagerTest.php +++ b/tests/lib/ContactsManagerTest.php @@ -232,7 +232,7 @@ class ContactsManagerTest extends \Test\TestCase { // register the address book $this->cm->registerAddressBook($addressbook); - $all_books = $this->cm->getAddressBooks(); + $all_books = $this->cm->getUserAddressBooks(); $this->assertEquals(1, count($all_books)); $this->assertEquals('A very simple Addressbook', $all_books['SIMPLE_ADDRESS_BOOK']); From 4123eeeaa3bbd3ecf7d78c42907d4bce024aaae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Fri, 30 Sep 2022 12:48:15 +0200 Subject: [PATCH 2/2] Fix ContactsManagerTest test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/lib/ContactsManagerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/ContactsManagerTest.php b/tests/lib/ContactsManagerTest.php index bc822214f26..c02a95a4162 100644 --- a/tests/lib/ContactsManagerTest.php +++ b/tests/lib/ContactsManagerTest.php @@ -235,6 +235,6 @@ class ContactsManagerTest extends \Test\TestCase { $all_books = $this->cm->getUserAddressBooks(); $this->assertEquals(1, count($all_books)); - $this->assertEquals('A very simple Addressbook', $all_books['SIMPLE_ADDRESS_BOOK']); + $this->assertEquals($addressbook, $all_books['SIMPLE_ADDRESS_BOOK']); } }