Skip to content

Commit 29d70d6

Browse files
committed
Refactor OC\Server::getContactsManager
Signed-off-by: Andrew Summers <[email protected]>
1 parent 9d1547f commit 29d70d6

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/private/Share/Share.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
namespace OC\Share;
3737

3838
use OCA\Files_Sharing\ShareBackend\File;
39+
use OCP\Contacts\IManager as IContactsManager;
3940
use OCP\DB\Exception;
4041
use OCP\DB\QueryBuilder\IQueryBuilder;
4142
use OCP\IDBConnection;
@@ -596,7 +597,7 @@ public static function getItems($itemType, ?string $item = null, ?int $shareType
596597
$row['share_with_displayname'] = $shareWithUser === null ? $row['share_with'] : $shareWithUser->getDisplayName();
597598
} elseif (isset($row['share_with']) && $row['share_with'] != '' &&
598599
$row['share_type'] === IShare::TYPE_REMOTE) {
599-
$addressBookEntries = \OC::$server->getContactsManager()->search($row['share_with'], ['CLOUD'], [
600+
$addressBookEntries = \OC::$server->get(IContactsManager::class)->search($row['share_with'], ['CLOUD'], [
600601
'limit' => 1,
601602
'enumeration' => false,
602603
'fullmatch' => false,

lib/public/Contacts/IManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ interface IManager {
5656
* Following function shows how to search for contacts for the name and the email address.
5757
*
5858
* public static function getMatchingRecipient($term) {
59-
* $cm = \OC::$server->getContactsManager();
59+
* $cm = \OC::$server->get(\OCP\Contacts\IManager::class);
6060
* // The API is not active -> nothing to do
6161
* if (!$cm->isEnabled()) {
6262
* return array();

0 commit comments

Comments
 (0)