Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-11-03 00:14:39 +0300
committerdartcafe <github@dartcafe.de>2020-11-03 00:14:39 +0300
commite5c6f0ccaa1a158d09d5e574779527a1c3a52cf0 (patch)
treec79b49f9339978a729e83c2992b922858a104f38 /lib/Model/Contact.php
parent24db4090cb59b004fda183a161c2738976b633ae (diff)
refactor exceptions
Diffstat (limited to 'lib/Model/Contact.php')
-rw-r--r--lib/Model/Contact.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Model/Contact.php b/lib/Model/Contact.php
index d718595c..2470cdbd 100644
--- a/lib/Model/Contact.php
+++ b/lib/Model/Contact.php
@@ -24,7 +24,7 @@
namespace OCA\Polls\Model;
use OCA\Polls\Exceptions\MultipleContactsFound;
-use OCA\Polls\Exceptions\ContactsNotEnabled;
+use OCA\Polls\Exceptions\ContactsNotEnabledExceptions;
class Contact extends UserGroupClass {
public const TYPE = 'contact';
@@ -79,6 +79,7 @@ class Contact extends UserGroupClass {
/**
* loadContact
* @NoAdminRequired
+ * @throws MultipleContactsFound
* The contacts app just provides a search, so we have to load the contact
* after searching via the contact's id and use the first contact.
*
@@ -101,6 +102,11 @@ class Contact extends UserGroupClass {
$this->contact = $contacts[0];
}
+ /**
+ * getContact
+ * @NoAdminRequired
+ * @throws ContactsNotEnabledExceptions
+ */
private function getContact() {
if (\OC::$server->getAppManager()->isEnabledForUser('contacts')) {
$this->resolveContactId();
@@ -131,7 +137,7 @@ class Contact extends UserGroupClass {
$this->description = \OC::$server->getL10N('polls')->t('Contact');
}
} else {
- throw new ContactsNotEnabled();
+ throw new ContactsNotEnabledExceptions();
}
}