aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Contacts/IManager.php2
-rw-r--r--lib/public/Mail/IMailer.php2
-rw-r--r--lib/public/Util.php3
3 files changed, 4 insertions, 3 deletions
diff --git a/lib/public/Contacts/IManager.php b/lib/public/Contacts/IManager.php
index 7a80a35e045..f19e72e0763 100644
--- a/lib/public/Contacts/IManager.php
+++ b/lib/public/Contacts/IManager.php
@@ -35,7 +35,7 @@ interface IManager {
* Following function shows how to search for contacts for the name and the email address.
*
* public static function getMatchingRecipient($term) {
- * $cm = \OC::$server->getContactsManager();
+ * $cm = \OCP\Server::get(\OCP\Contacts\IManager::class);
* // The API is not active -> nothing to do
* if (!$cm->isEnabled()) {
* return array();
diff --git a/lib/public/Mail/IMailer.php b/lib/public/Mail/IMailer.php
index dc49ed007b4..93efdce1a2d 100644
--- a/lib/public/Mail/IMailer.php
+++ b/lib/public/Mail/IMailer.php
@@ -14,7 +14,7 @@ namespace OCP\Mail;
*
* Example usage:
*
- * $mailer = \OC::$server->getMailer();
+ * $mailer = \OC::$server->get(\OCP\Mail\IMailer::class);
* $message = $mailer->createMessage();
* $message->setSubject('Your Subject');
* $message->setFrom(['cloud@domain.org' => 'Nextcloud Notifier']);
diff --git a/lib/public/Util.php b/lib/public/Util.php
index 20b4fe9c20d..179d4066c9b 100644
--- a/lib/public/Util.php
+++ b/lib/public/Util.php
@@ -14,6 +14,7 @@ use bantu\IniGetWrapper\IniGetWrapper;
use OC\AppScriptDependency;
use OC\AppScriptSort;
use OCP\L10N\IFactory;
+use OCP\Mail\IMailer;
use OCP\Share\IManager;
use Psr\Container\ContainerExceptionInterface;
use Psr\Log\LoggerInterface;
@@ -303,7 +304,7 @@ class Util {
$host_name = $config->getSystemValueString('mail_domain', $host_name);
$defaultEmailAddress = $user_part.'@'.$host_name;
- $mailer = \OC::$server->getMailer();
+ $mailer = \OC::$server->get(IMailer::class);
if ($mailer->validateMailAddress($defaultEmailAddress)) {
return $defaultEmailAddress;
}