diff --git a/lib/Provider/Command/MessageSend.php b/lib/Provider/Command/MessageSend.php index 6bc4b1337c..03342f5b63 100644 --- a/lib/Provider/Command/MessageSend.php +++ b/lib/Provider/Command/MessageSend.php @@ -34,16 +34,16 @@ public function __construct( * * @since 4.0.0 * - * @param string $userId system user id - * @param string $serviceId mail account id - * @param IMessage $message mail message object with all required parameters to send a message - * @param array $options array of options reserved for future use + * @param string $userId system user id + * @param string $serviceId mail account id + * @param IMessage $message mail message object with all required parameters to send a message + * @param array $options array of options reserved for future use * * @return LocalMessage */ public function perform(string $userId, string $serviceId, IMessage $message, array $option = []): LocalMessage { // find user mail account details - $account = $this->accountService->find($userId, (int) $serviceId); + $account = $this->accountService->find($userId, (int)$serviceId); // convert mail provider message to mail app message $localMessage = new LocalMessage(); $localMessage->setType($localMessage::TYPE_OUTGOING); @@ -62,7 +62,7 @@ public function perform(string $userId, string $serviceId, IMessage $message, ar foreach ($message->getAttachments() as $entry) { // determine if required parameters are set if (empty($entry->getName()) || empty($entry->getType()) || empty($entry->getContents())) { - throw new SendException("Invalid Attachment Parameter: MUST contain values for Name, Type and Contents"); + throw new SendException('Invalid Attachment Parameter: MUST contain values for Name, Type and Contents'); } // convert mail provider attachment to mail app attachment $attachments[] = $this->attachmentService->addFileFromString( @@ -75,7 +75,7 @@ public function perform(string $userId, string $serviceId, IMessage $message, ar } // determine if required To address is set if (empty($message->getTo()) || empty($message->getTo()[0]->getAddress())) { - throw new SendException("Invalid Message Parameter: MUST contain at least one TO address with a valid address"); + throw new SendException('Invalid Message Parameter: MUST contain at least one TO address with a valid address'); } // convert recipient addresses $to = $this->convertAddressArray($message->getTo()); @@ -105,7 +105,7 @@ public function perform(string $userId, string $serviceId, IMessage $message, ar * * @since 4.0.0 * - * @param array $addresses collection of IAddress objects + * @param array $addresses collection of IAddress objects * * @return array */ diff --git a/lib/Provider/MailProvider.php b/lib/Provider/MailProvider.php index e01a953875..96303371b9 100644 --- a/lib/Provider/MailProvider.php +++ b/lib/Provider/MailProvider.php @@ -30,7 +30,7 @@ public function __construct( * * @since 4.0.0 * - * @return string id of this provider (e.g. UUID or 'IMAP/SMTP' or anything else) + * @return string id of this provider (e.g. UUID or 'IMAP/SMTP' or anything else) */ public function id(): string { return 'mail-application'; @@ -41,7 +41,7 @@ public function id(): string { * * @since 4.0.0 * - * @return string label/name of this provider (e.g. Plain Old IMAP/SMTP) + * @return string label/name of this provider (e.g. Plain Old IMAP/SMTP) */ public function label(): string { return 'Mail Application'; @@ -52,9 +52,9 @@ public function label(): string { * * @since 4.0.0 * - * @param string $userId system user id + * @param string $userId system user id * - * @return bool true if any services are configure for the user + * @return bool true if any services are configure for the user */ public function hasServices(string $userId): bool { return (count($this->listServices($userId)) > 0); @@ -65,9 +65,9 @@ public function hasServices(string $userId): bool { * * @since 4.0.0 * - * @param string $userId system user id + * @param string $userId system user id * - * @return array collection of service id and object ['1' => IServiceObject] + * @return array collection of service id and object ['1' => IServiceObject] */ public function listServices(string $userId): array { @@ -82,7 +82,7 @@ public function listServices(string $userId): array { // add services to collection foreach ($accounts as $entry) { // extract values - $serviceId = (string) $entry->getId(); + $serviceId = (string)$entry->getId(); $label = $entry->getName(); $address = new MailAddress($entry->getEmail(), $entry->getName()); // add service to collection @@ -98,13 +98,13 @@ public function listServices(string $userId): array { * * @since 4.0.0 * - * @param string $userId system user id - * @param string $serviceId mail account id + * @param string $userId system user id + * @param string $serviceId mail account id * - * @return IService|null returns service object or null if none found + * @return IService|null returns service object or null if none found * */ - public function findServiceById(string $userId, string $serviceId): IService | null { + public function findServiceById(string $userId, string $serviceId): IService|null { // determine if a valid user and service id was submitted if (empty($userId) && !ctype_digit($serviceId)) { @@ -113,13 +113,13 @@ public function findServiceById(string $userId, string $serviceId): IService | n try { // retrieve service details from data store - $account = $this->accountService->find($userId, (int) $serviceId); + $account = $this->accountService->find($userId, (int)$serviceId); } catch(\Throwable $th) { return null; } // extract values - $serviceId = (string) $account->getId(); + $serviceId = (string)$account->getId(); $label = $account->getName(); $address = new MailAddress($account->getEmail(), $account->getName()); // return mail service object @@ -132,12 +132,12 @@ public function findServiceById(string $userId, string $serviceId): IService | n * * @since 4.0.0 * - * @param string $userId system user id - * @param string $address mail address (e.g. test@example.com) + * @param string $userId system user id + * @param string $address mail address (e.g. test@example.com) * - * @return IService|null returns service object or null if none found + * @return IService|null returns service object or null if none found */ - public function findServiceByAddress(string $userId, string $address): IService | null { + public function findServiceByAddress(string $userId, string $address): IService|null { try { // retrieve service details from data store @@ -148,7 +148,7 @@ public function findServiceByAddress(string $userId, string $address): IService // evaluate if service details where found if (isset($accounts[0])) { // extract values - $serviceId = (string) $accounts[0]->getId(); + $serviceId = (string)$accounts[0]->getId(); $serviceLabel = $accounts[0]->getName(); $serviceAddress = new MailAddress($accounts[0]->getEmail(), $accounts[0]->getName()); // return mail service object @@ -164,7 +164,7 @@ public function findServiceByAddress(string $userId, string $address): IService * * @since 4.0.0 * - * @return IService fresh service object + * @return IService fresh service object */ public function initiateService(): IService { diff --git a/lib/Provider/MailService.php b/lib/Provider/MailService.php index 42146dba4f..be03f5b7e9 100644 --- a/lib/Provider/MailService.php +++ b/lib/Provider/MailService.php @@ -37,7 +37,7 @@ public function __construct( * * @since 4.0.0 * - * @return string id of this service (e.g. 1 or service1 or anything else) + * @return string id of this service (e.g. 1 or service1 or anything else) */ public function id(): string { @@ -50,15 +50,15 @@ public function id(): string { * * @since 4.0.0 * - * @param string $value required ability e.g. 'MessageSend' + * @param string $value required ability e.g. 'MessageSend' * - * @return bool true/false if ability is supplied and found in collection + * @return bool true/false if ability is supplied and found in collection */ public function capable(string $value): bool { // evaluate if required ability exists if (isset($this->serviceAbilities[$value])) { - return (bool) $this->serviceAbilities[$value]; + return (bool)$this->serviceAbilities[$value]; } return false; @@ -70,7 +70,7 @@ public function capable(string $value): bool { * * @since 4.0.0 * - * @return array collection of abilities otherwise empty collection + * @return array collection of abilities otherwise empty collection */ public function capabilities(): array { @@ -83,7 +83,7 @@ public function capabilities(): array { * * @since 4.0.0 * - * @return string label/name of service (e.g. ACME Company Mail Service) + * @return string label/name of service (e.g. ACME Company Mail Service) */ public function getLabel(): string { @@ -96,9 +96,9 @@ public function getLabel(): string { * * @since 4.0.0 * - * @param string $value label/name of service (e.g. ACME Company Mail Service) + * @param string $value label/name of service (e.g. ACME Company Mail Service) * - * @return self return this object for command chaining + * @return self return this object for command chaining */ public function setLabel(string $value): self { @@ -112,7 +112,7 @@ public function setLabel(string $value): self { * * @since 4.0.0 * - * @return IAddress mail address object + * @return IAddress mail address object */ public function getPrimaryAddress(): IAddress { @@ -126,9 +126,9 @@ public function getPrimaryAddress(): IAddress { * * @since 4.0.0 * - * @param IAddress $value mail address object + * @param IAddress $value mail address object * - * @return self return this object for command chaining + * @return self return this object for command chaining */ public function setPrimaryAddress(IAddress $value): self { @@ -142,7 +142,7 @@ public function setPrimaryAddress(IAddress $value): self { * * @since 4.0.0 * - * @return array collection of mail address object [IAddress, IAddress] + * @return array collection of mail address object [IAddress, IAddress] */ public function getSecondaryAddresses(): array { @@ -156,9 +156,9 @@ public function getSecondaryAddresses(): array { * * @since 4.0.0 * - * @param IAddress ...$value collection of one or more mail address object + * @param IAddress ...$value collection of one or more mail address object * - * @return self return this object for command chaining + * @return self return this object for command chaining */ public function setSecondaryAddresses(IAddress ...$value): self { @@ -172,7 +172,7 @@ public function setSecondaryAddresses(IAddress ...$value): self { * * @since 30.0.0 * - * @return IMessage fresh message object + * @return IMessage fresh message object */ public function initiateMessage(): IMessage { @@ -185,8 +185,8 @@ public function initiateMessage(): IMessage { * * @since 4.0.0 * - * @param IMessage $message mail message object with all required parameters to send a message - * @param array $options array of options reserved for future use + * @param IMessage $message mail message object with all required parameters to send a message + * @param array $options array of options reserved for future use * * @throws \OCP\Mail\Provider\Exception\SendException on failure, check message for reason */