diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-14 17:06:46 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-14 17:06:46 +0300 |
commit | 7f32cfe6570d112fb748c9a97590e2b9d6e8aafb (patch) | |
tree | 931a9c6eaca5fafcd280f9fe7fa6c268631f60f2 /lib | |
parent | 2107b0f6ffe97ac40152207f7f90cc2a94ce46d1 (diff) |
Update to nextcloud coding standard v0.3.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
156 files changed, 193 insertions, 281 deletions
diff --git a/lib/Account.php b/lib/Account.php index 213a6e3c0..2934aebed 100644 --- a/lib/Account.php +++ b/lib/Account.php @@ -233,5 +233,4 @@ class Account implements JsonSerializable { public function newMessage() { return new Message(); } - } diff --git a/lib/Address.php b/lib/Address.php index c099893fd..aaac62adf 100644 --- a/lib/Address.php +++ b/lib/Address.php @@ -30,7 +30,6 @@ use Horde_Mail_Rfc822_Address; use JsonSerializable; class Address implements JsonSerializable { - public const TYPE_FROM = 0; public const TYPE_TO = 1; public const TYPE_CC = 2; @@ -95,5 +94,4 @@ class Address implements JsonSerializable { return $this->getEmail() === $object->getEmail() && $this->getLabel() === $object->getLabel(); } - } diff --git a/lib/AddressList.php b/lib/AddressList.php index 5319e5303..0fed80385 100644 --- a/lib/AddressList.php +++ b/lib/AddressList.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2017 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -60,12 +62,12 @@ class AddressList implements Countable, JsonSerializable { * @return AddressList */ public static function fromHorde(Horde_Mail_Rfc822_List $hordeList) { - $addresses = array_map(function(Horde_Mail_Rfc822_Address $addr) { + $addresses = array_map(function (Horde_Mail_Rfc822_Address $addr) { return new Address($addr->personal, $addr->bare_address); - }, array_filter(iterator_to_array($hordeList), function(Horde_Mail_Rfc822_Object $obj) { - // TODO: how to handle non-addresses? This doesn't seem right … - return $obj instanceof Horde_Mail_Rfc822_Address; - })); + }, array_filter(iterator_to_array($hordeList), function (Horde_Mail_Rfc822_Object $obj) { + // TODO: how to handle non-addresses? This doesn't seem right … + return $obj instanceof Horde_Mail_Rfc822_Address; + })); return new AddressList($addresses); } @@ -94,7 +96,7 @@ class AddressList implements Countable, JsonSerializable { * @return array */ public function jsonSerialize() { - return array_map(function(Address $address) { + return array_map(function (Address $address) { return $address->jsonSerialize(); }, $this->addresses); } @@ -126,8 +128,8 @@ class AddressList implements Countable, JsonSerializable { public function merge(AddressList $other) { $addresses = $this->addresses; - array_walk($other->addresses, function(Address $address) use (&$addresses) { - $same = array_filter($addresses, function(Address $our) use ($address) { + array_walk($other->addresses, function (Address $address) use (&$addresses) { + $same = array_filter($addresses, function (Address $our) use ($address) { // Check whether our array contains the other address return $our->equals($address); }); @@ -145,10 +147,9 @@ class AddressList implements Countable, JsonSerializable { * @return Horde_Mail_Rfc822_List */ public function toHorde() { - $hordeAddresses = array_map(function(Address $address) { + $hordeAddresses = array_map(function (Address $address) { return $address->toHorde(); }, $this->addresses); return new Horde_Mail_Rfc822_List($hordeAddresses); } - } diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index baee1c147..efa0a3f35 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -27,7 +27,6 @@ namespace OCA\Mail\AppInfo; use OCP\AppFramework\App; class Application extends App { - public const APP_ID = 'mail'; public function __construct(array $urlParams = []) { @@ -35,5 +34,4 @@ class Application extends App { BootstrapSingleton::getInstance($this->getContainer())->boot(); } - } diff --git a/lib/AppInfo/BootstrapSingleton.php b/lib/AppInfo/BootstrapSingleton.php index c40c80f57..1e605b794 100644 --- a/lib/AppInfo/BootstrapSingleton.php +++ b/lib/AppInfo/BootstrapSingleton.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -135,5 +137,4 @@ class BootstrapSingleton { $dispatcher->addServiceListener(MessageSentEvent::class, SaveSentMessageListener::class); $dispatcher->addServiceListener(SaveDraftEvent::class, DraftMailboxCreatorListener::class); } - } diff --git a/lib/BackgroundJob/SyncJob.php b/lib/BackgroundJob/SyncJob.php index 5fc7c05c0..262355483 100644 --- a/lib/BackgroundJob/SyncJob.php +++ b/lib/BackgroundJob/SyncJob.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> * @@ -80,5 +82,4 @@ class SyncJob extends TimedJob { $this->logger->logException($e); } } - } diff --git a/lib/Cache/Cache.php b/lib/Cache/Cache.php index e78b5fc61..3d935bc3a 100644 --- a/lib/Cache/Cache.php +++ b/lib/Cache/Cache.php @@ -35,7 +35,7 @@ use InvalidArgumentException; class Cache extends Horde_Imap_Client_Cache_Backend { /** Cache structure version. */ - const VERSION = 3; + public const VERSION = 3; /** * The cache object. @@ -476,5 +476,4 @@ class Cache extends Horde_Imap_Client_Cache_Backend { $this->save(); return parent::serialize(); } - } diff --git a/lib/Command/CreateAccount.php b/lib/Command/CreateAccount.php index bd90e8b62..0a0e3e2d5 100644 --- a/lib/Command/CreateAccount.php +++ b/lib/Command/CreateAccount.php @@ -32,20 +32,19 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class CreateAccount extends Command { - - const ARGUMENT_USER_ID = 'user-id'; - const ARGUMENT_NAME = 'name'; - const ARGUMENT_EMAIL = 'email'; - const ARGUMENT_IMAP_HOST = 'imap-host'; - const ARGUMENT_IMAP_PORT = 'imap-port'; - const ARGUMENT_IMAP_SSL_MODE = 'imap-ssl-mode'; - const ARGUMENT_IMAP_USER = 'imap-user'; - const ARGUMENT_IMAP_PASSWORD = 'imap-password'; - const ARGUMENT_SMTP_HOST = 'smtp-host'; - const ARGUMENT_SMTP_PORT = 'smtp-port'; - const ARGUMENT_SMTP_SSL_MODE = 'smtp-ssl-mode'; - const ARGUMENT_SMTP_USER = 'smtp-user'; - const ARGUMENT_SMTP_PASSWORD = 'smtp-password'; + public const ARGUMENT_USER_ID = 'user-id'; + public const ARGUMENT_NAME = 'name'; + public const ARGUMENT_EMAIL = 'email'; + public const ARGUMENT_IMAP_HOST = 'imap-host'; + public const ARGUMENT_IMAP_PORT = 'imap-port'; + public const ARGUMENT_IMAP_SSL_MODE = 'imap-ssl-mode'; + public const ARGUMENT_IMAP_USER = 'imap-user'; + public const ARGUMENT_IMAP_PASSWORD = 'imap-password'; + public const ARGUMENT_SMTP_HOST = 'smtp-host'; + public const ARGUMENT_SMTP_PORT = 'smtp-port'; + public const ARGUMENT_SMTP_SSL_MODE = 'smtp-ssl-mode'; + public const ARGUMENT_SMTP_USER = 'smtp-user'; + public const ARGUMENT_SMTP_PASSWORD = 'smtp-password'; /** @var AccountService */ private $accountService; @@ -124,5 +123,4 @@ class CreateAccount extends Command { $output->writeln("<info>Account $email created</info>"); } - } diff --git a/lib/Command/DiagnoseAccount.php b/lib/Command/DiagnoseAccount.php index 18e5ed29d..5d49be23a 100644 --- a/lib/Command/DiagnoseAccount.php +++ b/lib/Command/DiagnoseAccount.php @@ -40,7 +40,6 @@ use function json_decode; use function sort; class DiagnoseAccount extends Command { - private const ARGUMENT_ACCOUNT_ID = 'account-id'; /** @var AccountService */ @@ -139,5 +138,4 @@ class DiagnoseAccount extends Command { }, 0); $output->writeln("Account has " . $messages . " messages in " . count($mailboxes) . " mailboxes"); } - } diff --git a/lib/Command/ExportAccount.php b/lib/Command/ExportAccount.php index 4a0298ea2..0dfe13348 100644 --- a/lib/Command/ExportAccount.php +++ b/lib/Command/ExportAccount.php @@ -29,8 +29,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class ExportAccount extends Command { - - const ARGUMENT_USER_ID = 'user-id'; + public const ARGUMENT_USER_ID = 'user-id'; /** @var AccountService */ private $accountService; @@ -72,5 +71,4 @@ class ExportAccount extends Command { $output->writeln("- SMTP host: " . $account->getMailAccount()->getOutboundHost() . ":" . $account->getMailAccount()->getOutboundPort() . ", security: " . $account->getMailAccount()->getOutboundSslMode()); } } - } diff --git a/lib/Command/SyncAccount.php b/lib/Command/SyncAccount.php index accc03265..f8a206691 100644 --- a/lib/Command/SyncAccount.php +++ b/lib/Command/SyncAccount.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -37,9 +39,8 @@ use Symfony\Component\Console\Output\OutputInterface; use function memory_get_peak_usage; class SyncAccount extends Command { - - const ARGUMENT_ACCOUNT_ID = 'account-id'; - const OPTION_FORCE = 'force'; + public const ARGUMENT_ACCOUNT_ID = 'account-id'; + public const OPTION_FORCE = 'force'; /** @var AccountService */ private $accountService; @@ -98,5 +99,4 @@ class SyncAccount extends Command { $this->sync($account, $force, $output); } } - } diff --git a/lib/Contracts/IMailManager.php b/lib/Contracts/IMailManager.php index 2b86e621c..d8e839c2b 100644 --- a/lib/Contracts/IMailManager.php +++ b/lib/Contracts/IMailManager.php @@ -126,5 +126,4 @@ interface IMailManager { * @throws ServiceException */ public function flagMessage(Account $account, string $mailbox, int $uid, string $flag, bool $value): void; - } diff --git a/lib/Contracts/IMailSearch.php b/lib/Contracts/IMailSearch.php index 721fa4c4c..4ce094ffc 100644 --- a/lib/Contracts/IMailSearch.php +++ b/lib/Contracts/IMailSearch.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -55,5 +57,4 @@ interface IMailSearch { * @throws ServiceException */ public function findMessages(Account $account, string $mailboxName, ?string $filter, ?int $cursor): array; - } diff --git a/lib/Controller/AccountsController.php b/lib/Controller/AccountsController.php index b97b60e1a..9b342eab9 100644 --- a/lib/Controller/AccountsController.php +++ b/lib/Controller/AccountsController.php @@ -388,5 +388,4 @@ class AccountsController extends Controller { throw $ex; } } - } diff --git a/lib/Controller/AutoCompleteController.php b/lib/Controller/AutoCompleteController.php index b714c5e1d..b4e556867 100644 --- a/lib/Controller/AutoCompleteController.php +++ b/lib/Controller/AutoCompleteController.php @@ -51,5 +51,4 @@ class AutoCompleteController extends Controller { public function index(string $term): JSONResponse { return new JSONResponse($this->service->findMatches($term)); } - } diff --git a/lib/Controller/AvatarsController.php b/lib/Controller/AvatarsController.php index 7d5d26b7e..8d843996a 100644 --- a/lib/Controller/AvatarsController.php +++ b/lib/Controller/AvatarsController.php @@ -124,5 +124,4 @@ class AvatarsController extends Controller { $response->cacheFor(0); return $response; } - } diff --git a/lib/Controller/FoldersController.php b/lib/Controller/FoldersController.php index c00eae5bd..fd83394e5 100644 --- a/lib/Controller/FoldersController.php +++ b/lib/Controller/FoldersController.php @@ -124,7 +124,7 @@ class FoldersController extends Controller { $account, base64_decode($folderId), Horde_Imap_Client::SYNC_NEWMSGSUIDS | Horde_Imap_Client::SYNC_FLAGSUIDS | Horde_Imap_Client::SYNC_VANISHEDUIDS, - array_map(function($uid) { + array_map(function ($uid) { return (int) $uid; }, $uids), !$init, @@ -212,5 +212,4 @@ class FoldersController extends Controller { return new JSONResponse($this->mailManager->createFolder($account, $name)); } - } diff --git a/lib/Controller/LocalAttachmentsController.php b/lib/Controller/LocalAttachmentsController.php index ce98814ba..bcf6af69e 100644 --- a/lib/Controller/LocalAttachmentsController.php +++ b/lib/Controller/LocalAttachmentsController.php @@ -71,5 +71,4 @@ class LocalAttachmentsController extends Controller { return new JSONResponse($attachment, Http::STATUS_CREATED); } - } diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php index f73d78445..32c520d91 100755 --- a/lib/Controller/MessagesController.php +++ b/lib/Controller/MessagesController.php @@ -416,8 +416,8 @@ class MessagesController extends Controller { $attachment = $mailBox->getAttachment($messageId, $attachmentId); $fileName = $attachment->getName() ?? $this->l10n->t('Embedded message %s', [ - $attachmentId, - ]) . '.eml'; + $attachmentId, + ]) . '.eml'; $fileParts = pathinfo($fileName); $fileName = $fileParts['filename']; $fileExtension = $fileParts['extension']; @@ -540,10 +540,10 @@ class MessagesController extends Controller { private function attachmentIsImage(array $attachment): bool { return in_array( $attachment['mime'], [ - 'image/jpeg', - 'image/png', - 'image/gif' - ]); + 'image/jpeg', + 'image/png', + 'image/gif' + ]); } /** @@ -554,5 +554,4 @@ class MessagesController extends Controller { private function attachmentIsCalendarEvent(array $attachment): bool { return in_array($attachment['mime'], ['text/calendar', 'application/ics'], true); } - } diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 93d975381..59d95c0ee 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -185,5 +185,4 @@ class PageController extends Controller { $baseUrl = $this->urlGenerator->linkToRoute("mail.page.index"); return new RedirectResponse($baseUrl . $hashParams); } - } diff --git a/lib/Controller/PreferencesController.php b/lib/Controller/PreferencesController.php index 280f70422..201b8be38 100644 --- a/lib/Controller/PreferencesController.php +++ b/lib/Controller/PreferencesController.php @@ -80,5 +80,4 @@ class PreferencesController extends Controller { 'value' => $newValue, ]); } - } diff --git a/lib/Controller/ProxyController.php b/lib/Controller/ProxyController.php index 3f1acffef..1cafae9ce 100644 --- a/lib/Controller/ProxyController.php +++ b/lib/Controller/ProxyController.php @@ -124,5 +124,4 @@ class ProxyController extends Controller { $content = $response->getBody(); return new ProxyDownloadResponse($content, $src, 'application/octet-stream'); } - } diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index ccd80549d..32c7516ff 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -69,5 +71,4 @@ class SettingsController extends Controller { return new JSONResponse(null); } - } diff --git a/lib/Db/Alias.php b/lib/Db/Alias.php index eae912b5d..0124d1535 100644 --- a/lib/Db/Alias.php +++ b/lib/Db/Alias.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** diff --git a/lib/Db/AliasMapper.php b/lib/Db/AliasMapper.php index 6c9eabe8f..4673bdcae 100644 --- a/lib/Db/AliasMapper.php +++ b/lib/Db/AliasMapper.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** diff --git a/lib/Db/CollectedAddress.php b/lib/Db/CollectedAddress.php index aed152166..7d611d762 100644 --- a/lib/Db/CollectedAddress.php +++ b/lib/Db/CollectedAddress.php @@ -32,9 +32,7 @@ use OCP\AppFramework\Db\Entity; * @method string getDisplayName() */ class CollectedAddress extends Entity { - protected $userId; protected $email; protected $displayName; - } diff --git a/lib/Db/CollectedAddressMapper.php b/lib/Db/CollectedAddressMapper.php index 780e04153..e01073478 100644 --- a/lib/Db/CollectedAddressMapper.php +++ b/lib/Db/CollectedAddressMapper.php @@ -100,5 +100,4 @@ class CollectedAddressMapper extends QBMapper { return $this->findEntities($query); } - } diff --git a/lib/Db/LocalAttachment.php b/lib/Db/LocalAttachment.php index a10d697a3..f6dd8c50e 100644 --- a/lib/Db/LocalAttachment.php +++ b/lib/Db/LocalAttachment.php @@ -50,5 +50,4 @@ class LocalAttachment extends Entity implements JsonSerializable { 'fileName' => $this->fileName, ]; } - } diff --git a/lib/Db/LocalAttachmentMapper.php b/lib/Db/LocalAttachmentMapper.php index 2c6a182fb..c809e7b59 100644 --- a/lib/Db/LocalAttachmentMapper.php +++ b/lib/Db/LocalAttachmentMapper.php @@ -53,5 +53,4 @@ class LocalAttachmentMapper extends QBMapper { return $this->findEntity($query); } - } diff --git a/lib/Db/MailAccount.php b/lib/Db/MailAccount.php index 974e31b72..e4ee35a35 100644 --- a/lib/Db/MailAccount.php +++ b/lib/Db/MailAccount.php @@ -69,7 +69,6 @@ use OCP\AppFramework\Db\Entity; * @method void setOrder(int $order) */ class MailAccount extends Entity { - protected $userId; protected $name; protected $email; diff --git a/lib/Db/MailAccountMapper.php b/lib/Db/MailAccountMapper.php index 90a7d2ac7..8635113af 100644 --- a/lib/Db/MailAccountMapper.php +++ b/lib/Db/MailAccountMapper.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** @@ -136,7 +137,7 @@ class MailAccountMapper extends QBMapper { $delete->execute(); } - public function getAllAccounts(): array { + public function getAllAccounts(): array { $qb = $this->db->getQueryBuilder(); $query = $qb ->select('*') @@ -144,5 +145,4 @@ class MailAccountMapper extends QBMapper { return $this->findEntities($query); } - } diff --git a/lib/Db/Mailbox.php b/lib/Db/Mailbox.php index 544f8d599..3af793d50 100644 --- a/lib/Db/Mailbox.php +++ b/lib/Db/Mailbox.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -61,7 +63,6 @@ use function strtolower; * @method void setSpecialUse(string $specialUse) */ class Mailbox extends Entity { - protected $name; protected $accountId; protected $syncNewToken; @@ -126,5 +127,4 @@ class Mailbox extends Entity { || $this->getSyncChangedLock() !== null || $this->getSyncVanishedLock() !== null; } - } diff --git a/lib/Db/MailboxMapper.php b/lib/Db/MailboxMapper.php index 29f302ffc..28a48ceeb 100644 --- a/lib/Db/MailboxMapper.php +++ b/lib/Db/MailboxMapper.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -192,5 +194,4 @@ class MailboxMapper extends QBMapper { $this->update($mailbox); } - } diff --git a/lib/Db/Message.php b/lib/Db/Message.php index 0a791378b..e2c0bbb4b 100644 --- a/lib/Db/Message.php +++ b/lib/Db/Message.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -65,7 +67,6 @@ use function in_array; * @method int getUpdatedAt() */ class Message extends Entity implements JsonSerializable { - private const MUTABLE_FLAGS = [ 'answered', 'deleted', @@ -216,5 +217,4 @@ class Message extends Entity implements JsonSerializable { 'bcc' => $this->getBcc()->jsonSerialize(), ]; } - } diff --git a/lib/Db/MessageMapper.php b/lib/Db/MessageMapper.php index 9679a6b4d..901cd462a 100644 --- a/lib/Db/MessageMapper.php +++ b/lib/Db/MessageMapper.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -330,16 +332,16 @@ class MessageMapper extends QBMapper { $flags = $query->getFlags(); $flagKeys = array_keys($flags); foreach ([ - Horde_Imap_Client::FLAG_ANSWERED, - Horde_Imap_Client::FLAG_DELETED, - Horde_Imap_Client::FLAG_DRAFT, - Horde_Imap_Client::FLAG_FLAGGED, - Horde_Imap_Client::FLAG_RECENT, - Horde_Imap_Client::FLAG_SEEN, - Horde_Imap_Client::FLAG_FORWARDED, - Horde_Imap_Client::FLAG_JUNK, - Horde_Imap_Client::FLAG_NOTJUNK, - ] as $flag) { + Horde_Imap_Client::FLAG_ANSWERED, + Horde_Imap_Client::FLAG_DELETED, + Horde_Imap_Client::FLAG_DRAFT, + Horde_Imap_Client::FLAG_FLAGGED, + Horde_Imap_Client::FLAG_RECENT, + Horde_Imap_Client::FLAG_SEEN, + Horde_Imap_Client::FLAG_FORWARDED, + Horde_Imap_Client::FLAG_JUNK, + Horde_Imap_Client::FLAG_NOTJUNK, + ] as $flag) { if (in_array($flag, $flagKeys, true)) { $key = ltrim($flag, '\\'); $select->andWhere($qb->expr()->eq("flag_$key", $qb->createNamedParameter($flags[$flag], IQueryBuilder::PARAM_BOOL))); @@ -459,5 +461,4 @@ class MessageMapper extends QBMapper { return $this->findRecipients($this->findEntities($select)); } - } diff --git a/lib/Events/BeforeMessageDeletedEvent.php b/lib/Events/BeforeMessageDeletedEvent.php index be2b107e9..a77e4075f 100644 --- a/lib/Events/BeforeMessageDeletedEvent.php +++ b/lib/Events/BeforeMessageDeletedEvent.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -55,6 +57,4 @@ class BeforeMessageDeletedEvent extends Event { public function getMessageId(): int { return $this->messageId; } - - } diff --git a/lib/Events/DraftSavedEvent.php b/lib/Events/DraftSavedEvent.php index 79a385530..f8b6368da 100644 --- a/lib/Events/DraftSavedEvent.php +++ b/lib/Events/DraftSavedEvent.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -58,5 +60,4 @@ class DraftSavedEvent extends Event { public function getDraftUid(): ?int { return $this->draftUid; } - } diff --git a/lib/Events/MessageDeletedEvent.php b/lib/Events/MessageDeletedEvent.php index 46d9b0367..344f5f3d3 100644 --- a/lib/Events/MessageDeletedEvent.php +++ b/lib/Events/MessageDeletedEvent.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -58,6 +60,4 @@ class MessageDeletedEvent extends Event { public function getMessageId(): int { return $this->messageId; } - - } diff --git a/lib/Events/MessageFlaggedEvent.php b/lib/Events/MessageFlaggedEvent.php index 976648fc0..a5e5fa97e 100644 --- a/lib/Events/MessageFlaggedEvent.php +++ b/lib/Events/MessageFlaggedEvent.php @@ -78,5 +78,4 @@ class MessageFlaggedEvent extends Event { public function isSet(): bool { return $this->set; } - } diff --git a/lib/Events/MessageSentEvent.php b/lib/Events/MessageSentEvent.php index c0642e68a..563467c4c 100644 --- a/lib/Events/MessageSentEvent.php +++ b/lib/Events/MessageSentEvent.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -88,5 +90,4 @@ class MessageSentEvent extends Event { public function getMail(): Horde_Mime_Mail { return $this->mail; } - } diff --git a/lib/Events/SaveDraftEvent.php b/lib/Events/SaveDraftEvent.php index 699a63ae7..1f5590281 100644 --- a/lib/Events/SaveDraftEvent.php +++ b/lib/Events/SaveDraftEvent.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -58,5 +60,4 @@ class SaveDraftEvent extends Event { public function getDraftUid(): ?int { return $this->draftUid; } - } diff --git a/lib/Exception/AttachmentNotFoundException.php b/lib/Exception/AttachmentNotFoundException.php index 5f84bd78d..be1720e49 100644 --- a/lib/Exception/AttachmentNotFoundException.php +++ b/lib/Exception/AttachmentNotFoundException.php @@ -24,5 +24,4 @@ declare(strict_types=1); namespace OCA\Mail\Exception; class AttachmentNotFoundException extends ServiceException { - } diff --git a/lib/Exception/ClientException.php b/lib/Exception/ClientException.php index 3619ee04d..0daa4f8f9 100644 --- a/lib/Exception/ClientException.php +++ b/lib/Exception/ClientException.php @@ -30,9 +30,7 @@ use Exception; use OCP\AppFramework\Http; class ClientException extends Exception { - public function getHttpCode(): int { return Http::STATUS_BAD_REQUEST; } - } diff --git a/lib/Exception/IncompleteSyncException.php b/lib/Exception/IncompleteSyncException.php index 199a45e0b..b4af8f1f3 100644 --- a/lib/Exception/IncompleteSyncException.php +++ b/lib/Exception/IncompleteSyncException.php @@ -26,5 +26,4 @@ declare(strict_types=1); namespace OCA\Mail\Exception; class IncompleteSyncException extends ServiceException { - } diff --git a/lib/Exception/MailboxLockedException.php b/lib/Exception/MailboxLockedException.php index 8f66e50af..6fd5503c3 100644 --- a/lib/Exception/MailboxLockedException.php +++ b/lib/Exception/MailboxLockedException.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -27,7 +29,6 @@ use OCA\Mail\Db\Mailbox; use OCP\AppFramework\Http; class MailboxLockedException extends ClientException { - public static function from(Mailbox $mailbox): self { return new self($mailbox->getId() . ' is already being synced'); } @@ -35,5 +36,4 @@ class MailboxLockedException extends ClientException { public function getHttpCode(): int { return Http::STATUS_CONFLICT; } - } diff --git a/lib/Exception/MailboxNotCachedException.php b/lib/Exception/MailboxNotCachedException.php index 728700c92..5ae68de6b 100644 --- a/lib/Exception/MailboxNotCachedException.php +++ b/lib/Exception/MailboxNotCachedException.php @@ -1,13 +1,13 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); namespace OCA\Mail\Exception; use OCA\Mail\Db\Mailbox; class MailboxNotCachedException extends ClientException { - public static function from(Mailbox $mailbox): self { return new self("mailbox {$mailbox->getId()} is not cached"); } - } diff --git a/lib/Exception/NotImplemented.php b/lib/Exception/NotImplemented.php index 7148c388b..bb1069675 100644 --- a/lib/Exception/NotImplemented.php +++ b/lib/Exception/NotImplemented.php @@ -29,5 +29,4 @@ namespace OCA\Mail\Exception; use Exception; class NotImplemented extends Exception { - } diff --git a/lib/Exception/ServiceException.php b/lib/Exception/ServiceException.php index 3387287d4..68e8a7de0 100644 --- a/lib/Exception/ServiceException.php +++ b/lib/Exception/ServiceException.php @@ -26,5 +26,4 @@ namespace OCA\Mail\Exception; use Exception; class ServiceException extends Exception { - } diff --git a/lib/Exception/UidValidityChangedException.php b/lib/Exception/UidValidityChangedException.php index 9000909c2..7f8171ae9 100644 --- a/lib/Exception/UidValidityChangedException.php +++ b/lib/Exception/UidValidityChangedException.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -26,5 +28,4 @@ namespace OCA\mail\lib\Exception; use OCA\Mail\Exception\ServiceException; class UidValidityChangedException extends ServiceException { - } diff --git a/lib/Exception/UploadException.php b/lib/Exception/UploadException.php index bacc619a0..c766c1a94 100644 --- a/lib/Exception/UploadException.php +++ b/lib/Exception/UploadException.php @@ -24,5 +24,4 @@ declare(strict_types=1); namespace OCA\Mail\Exception; class UploadException extends ServiceException { - } diff --git a/lib/Folder.php b/lib/Folder.php index 2052add40..d17ed0b9b 100644 --- a/lib/Folder.php +++ b/lib/Folder.php @@ -160,5 +160,4 @@ class Folder implements JsonSerializable { public function isSelectable(): bool { return !in_array('\noselect', $this->attributes); } - } diff --git a/lib/HordeTranslationHandler.php b/lib/HordeTranslationHandler.php index 77530c22d..1ac40cba2 100644 --- a/lib/HordeTranslationHandler.php +++ b/lib/HordeTranslationHandler.php @@ -23,7 +23,7 @@ namespace OCA\Mail; use Horde_Translation_Handler; -class HordeTranslationHandler implements Horde_Translation_Handler { +class HordeTranslationHandler implements Horde_Translation_Handler { /** * Returns the translation of a message. * diff --git a/lib/Http/AttachmentDownloadResponse.php b/lib/Http/AttachmentDownloadResponse.php index 7784a0fe5..d9789a423 100644 --- a/lib/Http/AttachmentDownloadResponse.php +++ b/lib/Http/AttachmentDownloadResponse.php @@ -53,5 +53,4 @@ class AttachmentDownloadResponse extends DownloadResponse { public function render(): string { return $this->content; } - } diff --git a/lib/Http/AvatarDownloadResponse.php b/lib/Http/AvatarDownloadResponse.php index 532c464c5..70cce9756 100644 --- a/lib/Http/AvatarDownloadResponse.php +++ b/lib/Http/AvatarDownloadResponse.php @@ -44,5 +44,4 @@ class AvatarDownloadResponse extends DownloadResponse { public function render(): string { return $this->content; } - } diff --git a/lib/Http/HtmlResponse.php b/lib/Http/HtmlResponse.php index a61a826a4..cae7c97bb 100644 --- a/lib/Http/HtmlResponse.php +++ b/lib/Http/HtmlResponse.php @@ -45,5 +45,4 @@ class HtmlResponse extends Response { public function render(): string { return $this->content; } - } diff --git a/lib/Http/JsonResponse.php b/lib/Http/JsonResponse.php index 8c5cc9396..b811fbddb 100644 --- a/lib/Http/JsonResponse.php +++ b/lib/Http/JsonResponse.php @@ -39,7 +39,6 @@ use function get_class; * @see https://github.com/omniti-labs/jsend */ class JsonResponse extends Base { - public function __construct($data = [], int $statusCode = Http::STATUS_OK) { parent::__construct($data, $statusCode); @@ -127,5 +126,4 @@ class JsonResponse extends Base { array_flip(['file', 'line', 'function', 'class'])); }, $original); } - } diff --git a/lib/Http/Middleware/ErrorMiddleware.php b/lib/Http/Middleware/ErrorMiddleware.php index be0735ef5..c7e2cb0ad 100644 --- a/lib/Http/Middleware/ErrorMiddleware.php +++ b/lib/Http/Middleware/ErrorMiddleware.php @@ -129,5 +129,4 @@ class ErrorMiddleware extends Middleware { return false; } - } diff --git a/lib/Http/Middleware/ProvisioningMiddleware.php b/lib/Http/Middleware/ProvisioningMiddleware.php index bcbb180fa..6d36a2360 100644 --- a/lib/Http/Middleware/ProvisioningMiddleware.php +++ b/lib/Http/Middleware/ProvisioningMiddleware.php @@ -79,5 +79,4 @@ class ProvisioningMiddleware extends Middleware { return; } } - } diff --git a/lib/Http/ProxyDownloadResponse.php b/lib/Http/ProxyDownloadResponse.php index 72929b8c3..b8977bd8d 100644 --- a/lib/Http/ProxyDownloadResponse.php +++ b/lib/Http/ProxyDownloadResponse.php @@ -60,5 +60,4 @@ class ProxyDownloadResponse extends DownloadResponse { public function render(): string { return $this->content; } - } diff --git a/lib/IMAP/FolderMapper.php b/lib/IMAP/FolderMapper.php index d217ad260..4f677f853 100644 --- a/lib/IMAP/FolderMapper.php +++ b/lib/IMAP/FolderMapper.php @@ -62,7 +62,7 @@ class FolderMapper { 'special_use' => true, ]); - return array_filter(array_map(function(array $mailbox) use ($account) { + return array_filter(array_map(function (array $mailbox) use ($account) { if (in_array($mailbox['mailbox']->utf8, self::DOVECOT_SIEVE_FOLDERS, true)) { // This is a special folder that must not be shown return null; @@ -219,5 +219,4 @@ class FolderMapper { } } } - } diff --git a/lib/IMAP/FolderStats.php b/lib/IMAP/FolderStats.php index 9b41b91d8..a1e39ed9b 100644 --- a/lib/IMAP/FolderStats.php +++ b/lib/IMAP/FolderStats.php @@ -36,7 +36,6 @@ class FolderStats implements JsonSerializable { private $unread; public function __construct(int $total, int $unread) { - $this->total = $total; $this->unread = $unread; } diff --git a/lib/IMAP/IMAPClientFactory.php b/lib/IMAP/IMAPClientFactory.php index e89266aca..6ef1c7b33 100644 --- a/lib/IMAP/IMAPClientFactory.php +++ b/lib/IMAP/IMAPClientFactory.php @@ -98,5 +98,4 @@ class IMAPClientFactory { return $this->cache[$account->getId()]; } - } diff --git a/lib/IMAP/MailboxSync.php b/lib/IMAP/MailboxSync.php index e1ec145df..e1461189a 100644 --- a/lib/IMAP/MailboxSync.php +++ b/lib/IMAP/MailboxSync.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -145,5 +147,4 @@ class MailboxSync { $mailbox->setSpecialUse(json_encode($folder->getSpecialUse())); $this->mailboxMapper->insert($mailbox); } - } diff --git a/lib/IMAP/MessageMapper.php b/lib/IMAP/MessageMapper.php index a048bfaaf..be8240410 100644 --- a/lib/IMAP/MessageMapper.php +++ b/lib/IMAP/MessageMapper.php @@ -23,14 +23,12 @@ declare(strict_types=1); namespace OCA\Mail\IMAP; -use Generator; use Horde_Imap_Client; use Horde_Imap_Client_Base; use Horde_Imap_Client_Data_Fetch; use Horde_Imap_Client_Exception; use Horde_Imap_Client_Fetch_Query; use Horde_Imap_Client_Ids; -use Horde_Imap_Client_Search_Query; use Horde_Imap_Client_Socket; use Horde_Mime_Mail; use Horde_Mime_Part; @@ -552,5 +550,4 @@ class MessageMapper { return new MessageStructureData($hasAttachments, $text); }, iterator_to_array($structures->getIterator())); } - } diff --git a/lib/IMAP/MessageStructureData.php b/lib/IMAP/MessageStructureData.php index 5abe99976..d5084db82 100644 --- a/lib/IMAP/MessageStructureData.php +++ b/lib/IMAP/MessageStructureData.php @@ -46,5 +46,4 @@ class MessageStructureData { public function getPreviewText(): string { return $this->previewText; } - } diff --git a/lib/IMAP/PreviewEnhancer.php b/lib/IMAP/PreviewEnhancer.php index de2170eb3..f7fc5472d 100644 --- a/lib/IMAP/PreviewEnhancer.php +++ b/lib/IMAP/PreviewEnhancer.php @@ -112,5 +112,4 @@ class PreviewEnhancer { return $message; }, $messages)); } - } diff --git a/lib/IMAP/Search/Provider.php b/lib/IMAP/Search/Provider.php index 4f39f29ae..57f53c748 100644 --- a/lib/IMAP/Search/Provider.php +++ b/lib/IMAP/Search/Provider.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -85,5 +87,4 @@ class Provider { new Horde_Imap_Client_Search_Query() ); } - } diff --git a/lib/IMAP/Sync/Request.php b/lib/IMAP/Sync/Request.php index 5e8b890ee..ecf7061b6 100644 --- a/lib/IMAP/Sync/Request.php +++ b/lib/IMAP/Sync/Request.php @@ -67,5 +67,4 @@ class Request { public function getUids(): array { return $this->uids; } - } diff --git a/lib/IMAP/Sync/Response.php b/lib/IMAP/Sync/Response.php index a690c673d..9e95b342e 100644 --- a/lib/IMAP/Sync/Response.php +++ b/lib/IMAP/Sync/Response.php @@ -87,5 +87,4 @@ class Response implements JsonSerializable { array_merge($this->getVanishedMessageUids(), $other->getVanishedMessageUids()) ); } - } diff --git a/lib/IMAP/Sync/Synchronizer.php b/lib/IMAP/Sync/Synchronizer.php index 3b5b07fd4..43d0f5d75 100644 --- a/lib/IMAP/Sync/Synchronizer.php +++ b/lib/IMAP/Sync/Synchronizer.php @@ -74,5 +74,4 @@ class Synchronizer { return new Response($newMessages, $changedMessages, $vanishedMessageUids); } - } diff --git a/lib/Integration/KItinerary/ItineraryExtractor.php b/lib/Integration/KItinerary/ItineraryExtractor.php index 9e6e6e932..e38f96f84 100644 --- a/lib/Integration/KItinerary/ItineraryExtractor.php +++ b/lib/Integration/KItinerary/ItineraryExtractor.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -84,5 +86,4 @@ class ItineraryExtractor { return new Itinerary(); } } - } diff --git a/lib/Integration/Psr/LoggerAdapter.php b/lib/Integration/Psr/LoggerAdapter.php index abcd068a4..a676b848c 100644 --- a/lib/Integration/Psr/LoggerAdapter.php +++ b/lib/Integration/Psr/LoggerAdapter.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -154,5 +156,4 @@ class LoggerAdapter implements LoggerInterface { public function log($level, $message, array $context = []) { $this->logger->log($level, $message, $context); } - } diff --git a/lib/Listener/AddressCollectionListener.php b/lib/Listener/AddressCollectionListener.php index 2f227157d..22d079537 100644 --- a/lib/Listener/AddressCollectionListener.php +++ b/lib/Listener/AddressCollectionListener.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -74,5 +76,4 @@ class AddressCollectionListener implements IEventListener { ]); } } - } diff --git a/lib/Listener/DeleteDraftListener.php b/lib/Listener/DeleteDraftListener.php index 8c204bfc9..0e76adec6 100644 --- a/lib/Listener/DeleteDraftListener.php +++ b/lib/Listener/DeleteDraftListener.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -70,7 +72,7 @@ class DeleteDraftListener implements IEventListener { public function handle(Event $event): void { if ($event instanceof DraftSavedEvent && $event->getDraftUid() !== null) { $this->deleteDraft($event->getAccount(), $event->getDraftUid()); - } else if ($event instanceof MessageSentEvent && $event->getDraftUid() !== null) { + } elseif ($event instanceof MessageSentEvent && $event->getDraftUid() !== null) { $this->deleteDraft($event->getAccount(), $event->getDraftUid()); } } @@ -138,5 +140,4 @@ class DeleteDraftListener implements IEventListener { // TODO: find a more elegant solution for updating the mailbox cache $this->mailboxSync->sync($account, true); } - } diff --git a/lib/Listener/DraftMailboxCreatorListener.php b/lib/Listener/DraftMailboxCreatorListener.php index fdb705f1a..384a39221 100644 --- a/lib/Listener/DraftMailboxCreatorListener.php +++ b/lib/Listener/DraftMailboxCreatorListener.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -94,5 +96,4 @@ class DraftMailboxCreatorListener implements IEventListener { // TODO: find a more elegant solution for updating the mailbox cache $this->mailboxSync->sync($account, true); } - } diff --git a/lib/Listener/FlagRepliedMessageListener.php b/lib/Listener/FlagRepliedMessageListener.php index eb2c3b73d..07e13bb13 100644 --- a/lib/Listener/FlagRepliedMessageListener.php +++ b/lib/Listener/FlagRepliedMessageListener.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -53,7 +55,6 @@ class FlagRepliedMessageListener implements IEventListener { MailboxMapper $mailboxMapper, MessageMapper $mapper, ILogger $logger) { - $this->imapClientFactory = $imapClientFactory; $this->mailboxMapper = $mailboxMapper; $this->messageMapper = $mapper; @@ -94,5 +95,4 @@ class FlagRepliedMessageListener implements IEventListener { ]); } } - } diff --git a/lib/Listener/InteractionListener.php b/lib/Listener/InteractionListener.php index ce48b5635..58c3e22b9 100644 --- a/lib/Listener/InteractionListener.php +++ b/lib/Listener/InteractionListener.php @@ -84,5 +84,4 @@ class InteractionListener implements IEventListener { $this->dispatcher->dispatch(ContactInteractedWithEvent::class, $interactionEvent); } } - } diff --git a/lib/Listener/MessageCacheUpdaterListener.php b/lib/Listener/MessageCacheUpdaterListener.php index bd710adb1..6c952ed63 100644 --- a/lib/Listener/MessageCacheUpdaterListener.php +++ b/lib/Listener/MessageCacheUpdaterListener.php @@ -66,5 +66,4 @@ class MessageCacheUpdaterListener implements IEventListener { ); } } - } diff --git a/lib/Listener/SaveSentMessageListener.php b/lib/Listener/SaveSentMessageListener.php index 3f6bf9375..ed093d222 100644 --- a/lib/Listener/SaveSentMessageListener.php +++ b/lib/Listener/SaveSentMessageListener.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -122,5 +124,4 @@ class SaveSentMessageListener implements IEventListener { return $this->mailboxMapper->findSpecial($account, 'sent'); } - } diff --git a/lib/Listener/TrashMailboxCreatorListener.php b/lib/Listener/TrashMailboxCreatorListener.php index a3a00b2b1..a4cb09336 100644 --- a/lib/Listener/TrashMailboxCreatorListener.php +++ b/lib/Listener/TrashMailboxCreatorListener.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -97,5 +99,4 @@ class TrashMailboxCreatorListener implements IEventListener { ]); } } - } diff --git a/lib/Mailbox.php b/lib/Mailbox.php index 128fe3c06..09daef680 100644 --- a/lib/Mailbox.php +++ b/lib/Mailbox.php @@ -251,7 +251,7 @@ class Mailbox implements IMailBox { strtolower(Horde_Imap_Client::SPECIALUSE_TRASH) ]; - $attributes = array_map(function($n) { + $attributes = array_map(function ($n) { return strtolower($n); }, $this->attributes); @@ -272,7 +272,6 @@ class Mailbox implements IMailBox { * @return void */ protected function guessSpecialRole(): void { - $specialFoldersDict = [ 'inbox' => ['inbox'], 'sent' => ['sent', 'sent items', 'sent messages', 'sent-mail', 'sentmail'], @@ -321,5 +320,4 @@ class Mailbox implements IMailBox { return reset($uids); } - } diff --git a/lib/Migration/FixAccountSyncs.php b/lib/Migration/FixAccountSyncs.php index 319e0cb4e..ba2166e85 100644 --- a/lib/Migration/FixAccountSyncs.php +++ b/lib/Migration/FixAccountSyncs.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> @@ -60,5 +61,4 @@ class FixAccountSyncs implements IRepairStep { $output->finishProgress(); } - } diff --git a/lib/Migration/FixCollectedAddresses.php b/lib/Migration/FixCollectedAddresses.php index 7ab0a98f5..85e18e383 100644 --- a/lib/Migration/FixCollectedAddresses.php +++ b/lib/Migration/FixCollectedAddresses.php @@ -82,5 +82,4 @@ class FixCollectedAddresses implements IRepairStep { $this->mapper->delete($address); } } - } diff --git a/lib/Migration/MakeItineraryExtractorExecutable.php b/lib/Migration/MakeItineraryExtractorExecutable.php index 93d26bd32..3d085f0b0 100644 --- a/lib/Migration/MakeItineraryExtractorExecutable.php +++ b/lib/Migration/MakeItineraryExtractorExecutable.php @@ -74,5 +74,4 @@ class MakeItineraryExtractorExecutable implements IRepairStep { return; } } - } diff --git a/lib/Migration/MigrateProvisioningConfig.php b/lib/Migration/MigrateProvisioningConfig.php index 7f8bbe29d..12b90c8f8 100644 --- a/lib/Migration/MigrateProvisioningConfig.php +++ b/lib/Migration/MigrateProvisioningConfig.php @@ -62,5 +62,4 @@ class MigrateProvisioningConfig implements IRepairStep { $this->config->deleteSystemValue('app.mail.accounts.default'); $output->info("Config migrated. Accounts not updated yet"); } - } diff --git a/lib/Migration/ProvisionAccounts.php b/lib/Migration/ProvisionAccounts.php index 21d6e8b30..8487492ca 100644 --- a/lib/Migration/ProvisionAccounts.php +++ b/lib/Migration/ProvisionAccounts.php @@ -56,5 +56,4 @@ class ProvisionAccounts implements IRepairStep { $cnt = $this->provisioningManager->provision($config); $output->info("$cnt accounts provisioned"); } - } diff --git a/lib/Migration/Version0130Date20190408134101.php b/lib/Migration/Version0130Date20190408134101.php index 71b087979..f50a3a7d1 100644 --- a/lib/Migration/Version0130Date20190408134101.php +++ b/lib/Migration/Version0130Date20190408134101.php @@ -51,5 +51,4 @@ class Version0130Date20190408134101 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version0156Date20190828140357.php b/lib/Migration/Version0156Date20190828140357.php index 42268400a..4afca33a5 100644 --- a/lib/Migration/Version0156Date20190828140357.php +++ b/lib/Migration/Version0156Date20190828140357.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -87,5 +89,4 @@ class Version0156Date20190828140357 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version0161Date20190902103559.php b/lib/Migration/Version0161Date20190902103559.php index 2e387d811..8f5ba58aa 100644 --- a/lib/Migration/Version0161Date20190902103559.php +++ b/lib/Migration/Version0161Date20190902103559.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -44,5 +46,4 @@ class Version0161Date20190902103559 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version0161Date20190902103701.php b/lib/Migration/Version0161Date20190902103701.php index 14cf6a64b..99fa87645 100644 --- a/lib/Migration/Version0161Date20190902103701.php +++ b/lib/Migration/Version0161Date20190902103701.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -104,5 +106,4 @@ class Version0161Date20190902103701 extends SimpleMigrationStep { ->set('last_mailbox_sync', $update->createNamedParameter(0)); $update->execute(); } - } diff --git a/lib/Migration/Version0161Date20190902114635.php b/lib/Migration/Version0161Date20190902114635.php index d3e9e718a..05534acfb 100644 --- a/lib/Migration/Version0161Date20190902114635.php +++ b/lib/Migration/Version0161Date20190902114635.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -66,5 +68,4 @@ class Version0161Date20190902114635 extends SimpleMigrationStep { $update->execute(); } - } diff --git a/lib/Migration/Version0180Date20190927124207.php b/lib/Migration/Version0180Date20190927124207.php index fc775a5d9..20b259c0a 100644 --- a/lib/Migration/Version0180Date20190927124207.php +++ b/lib/Migration/Version0180Date20190927124207.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -50,5 +52,4 @@ class Version0180Date20190927124207 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version0190Date20191118160843.php b/lib/Migration/Version0190Date20191118160843.php index 5ea0f4548..11624c166 100644 --- a/lib/Migration/Version0190Date20191118160843.php +++ b/lib/Migration/Version0190Date20191118160843.php @@ -55,5 +55,4 @@ class Version0190Date20191118160843 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version0210Date20191212144925.php b/lib/Migration/Version0210Date20191212144925.php index 96257093c..3016e1eaf 100644 --- a/lib/Migration/Version0210Date20191212144925.php +++ b/lib/Migration/Version0210Date20191212144925.php @@ -51,5 +51,4 @@ class Version0210Date20191212144925 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version1020Date20191002091034.php b/lib/Migration/Version1020Date20191002091034.php index 4020be614..f5cbb3b68 100644 --- a/lib/Migration/Version1020Date20191002091034.php +++ b/lib/Migration/Version1020Date20191002091034.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); namespace OCA\Mail\Migration; @@ -29,5 +31,4 @@ class Version1020Date20191002091034 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version1020Date20191002091035.php b/lib/Migration/Version1020Date20191002091035.php index d0cb3b054..bd35180d1 100644 --- a/lib/Migration/Version1020Date20191002091035.php +++ b/lib/Migration/Version1020Date20191002091035.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); namespace OCA\Mail\Migration; @@ -153,5 +155,4 @@ class Version1020Date20191002091035 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version1020Date20200206134751.php b/lib/Migration/Version1020Date20200206134751.php index 658cf2891..a9765a016 100644 --- a/lib/Migration/Version1020Date20200206134751.php +++ b/lib/Migration/Version1020Date20200206134751.php @@ -37,5 +37,4 @@ class Version1020Date20200206134751 extends SimpleMigrationStep { return $schema; } - } diff --git a/lib/Migration/Version1030Date20200228105714.php b/lib/Migration/Version1030Date20200228105714.php index c2765626e..68b48e5dd 100644 --- a/lib/Migration/Version1030Date20200228105714.php +++ b/lib/Migration/Version1030Date20200228105714.php @@ -24,5 +24,4 @@ class Version1030Date20200228105714 extends SimpleMigrationStep { ->set('last_mailbox_sync', $update->createNamedParameter(0)); $update->execute(); } - } diff --git a/lib/Model/ConvertAddresses.php b/lib/Model/ConvertAddresses.php index e375002a1..7ccd49bf3 100644 --- a/lib/Model/ConvertAddresses.php +++ b/lib/Model/ConvertAddresses.php @@ -28,7 +28,6 @@ use Horde_Mail_Rfc822_List; use Horde_Mail_Rfc822_Address; trait ConvertAddresses { - private function hordeToString(Horde_Mail_Rfc822_Address $address): string { return $address->writeAddress(); } @@ -67,5 +66,4 @@ trait ConvertAddresses { } return $list; } - } diff --git a/lib/Model/IMAPMessage.php b/lib/Model/IMAPMessage.php index 180ea30d5..3b7be1060 100644 --- a/lib/Model/IMAPMessage.php +++ b/lib/Model/IMAPMessage.php @@ -51,7 +51,6 @@ use function base64_encode; use function mb_convert_encoding; class IMAPMessage implements IMessage, JsonSerializable { - use ConvertAddresses; /** @@ -651,5 +650,4 @@ class IMAPMessage implements IMessage, JsonSerializable { return $msg; } - } diff --git a/lib/Model/Message.php b/lib/Model/Message.php index 716127873..55ebcf743 100644 --- a/lib/Model/Message.php +++ b/lib/Model/Message.php @@ -30,7 +30,6 @@ use OCP\Files\File; use OCP\Files\SimpleFS\ISimpleFile; class Message implements IMessage { - use ConvertAddresses; /** @var string */ @@ -253,5 +252,4 @@ class Message implements IMessage { $part->setType($file->getMimeType()); $this->localAttachments[] = $part; } - } diff --git a/lib/Model/NewMessageData.php b/lib/Model/NewMessageData.php index f802b2033..f578e049d 100644 --- a/lib/Model/NewMessageData.php +++ b/lib/Model/NewMessageData.php @@ -162,5 +162,4 @@ class NewMessageData { public function isHtml(): bool { return $this->isHtml; } - } diff --git a/lib/Model/RepliedMessageData.php b/lib/Model/RepliedMessageData.php index 65f5be8c3..d12584874 100644 --- a/lib/Model/RepliedMessageData.php +++ b/lib/Model/RepliedMessageData.php @@ -64,5 +64,4 @@ class RepliedMessageData { public function getId(): int { return $this->id; } - } diff --git a/lib/SMTP/SmtpClientFactory.php b/lib/SMTP/SmtpClientFactory.php index 40d69f6a6..6e4d50874 100644 --- a/lib/SMTP/SmtpClientFactory.php +++ b/lib/SMTP/SmtpClientFactory.php @@ -88,5 +88,4 @@ class SmtpClientFactory { } return new Horde_Mail_Transport_Smtphorde($params); } - } diff --git a/lib/Service/AccountService.php b/lib/Service/AccountService.php index 0795237ee..c18b92c64 100644 --- a/lib/Service/AccountService.php +++ b/lib/Service/AccountService.php @@ -68,7 +68,8 @@ class AccountService { if ($this->accounts === null) { return $this->accounts = array_map(function ($a) { return new Account($a); - }, $this->mapper->findByUserId($currentUserId));; + }, $this->mapper->findByUserId($currentUserId)); + ; } return $this->accounts; @@ -153,5 +154,4 @@ class AccountService { $mailAccount->setSignature($signature); $this->mapper->save($mailAccount); } - } diff --git a/lib/Service/Attachment/AttachmentService.php b/lib/Service/Attachment/AttachmentService.php index d9fe9c693..431873884 100644 --- a/lib/Service/Attachment/AttachmentService.php +++ b/lib/Service/Attachment/AttachmentService.php @@ -101,5 +101,4 @@ class AttachmentService implements IAttachmentService { } $this->storage->delete($userId, $id); } - } diff --git a/lib/Service/Attachment/AttachmentStorage.php b/lib/Service/Attachment/AttachmentStorage.php index 7616e1a40..528ab6f82 100644 --- a/lib/Service/Attachment/AttachmentStorage.php +++ b/lib/Service/Attachment/AttachmentStorage.php @@ -111,5 +111,4 @@ class AttachmentStorage { public function delete(string $userId, int $attachmentId): void { throw new Exception('not implemented'); } - } diff --git a/lib/Service/Attachment/UploadedFile.php b/lib/Service/Attachment/UploadedFile.php index f28ddbf7e..e99fb5f20 100644 --- a/lib/Service/Attachment/UploadedFile.php +++ b/lib/Service/Attachment/UploadedFile.php @@ -49,5 +49,4 @@ class UploadedFile { public function getTempPath() { return isset($this->fileData['tmp_name']) ? $this->fileData['tmp_name'] : null; } - } diff --git a/lib/Service/AutoCompletion/AddressCollector.php b/lib/Service/AutoCompletion/AddressCollector.php index d1304d62f..8dbf5270c 100644 --- a/lib/Service/AutoCompletion/AddressCollector.php +++ b/lib/Service/AutoCompletion/AddressCollector.php @@ -105,5 +105,4 @@ class AddressCollector { $this->logger->debug("found " . count($result) . " matches in collected addresses"); return $result; } - } diff --git a/lib/Service/AutoCompletion/AutoCompleteService.php b/lib/Service/AutoCompletion/AutoCompleteService.php index ddf8a88e2..f17f8d7ff 100644 --- a/lib/Service/AutoCompletion/AutoCompleteService.php +++ b/lib/Service/AutoCompletion/AutoCompleteService.php @@ -61,5 +61,4 @@ class AutoCompleteService { return array_merge($recipientsFromContacts, $recipientsFromCollector, $recipientGroups); } - } diff --git a/lib/Service/AutoConfig/AutoConfig.php b/lib/Service/AutoConfig/AutoConfig.php index a93cfc9c7..9166a638b 100644 --- a/lib/Service/AutoConfig/AutoConfig.php +++ b/lib/Service/AutoConfig/AutoConfig.php @@ -56,5 +56,4 @@ class AutoConfig { } return $this->configDetector->detectImapAndSmtp($email, $password, $name); } - } diff --git a/lib/Service/AutoConfig/ConfigurationDetector.php b/lib/Service/AutoConfig/ConfigurationDetector.php index 3f15fc8e7..4776f4dd1 100644 --- a/lib/Service/AutoConfig/ConfigurationDetector.php +++ b/lib/Service/AutoConfig/ConfigurationDetector.php @@ -61,5 +61,4 @@ class ConfigurationDetector { return $account; } - } diff --git a/lib/Service/AutoConfig/ConnectivityTester.php b/lib/Service/AutoConfig/ConnectivityTester.php index 5313ae466..322c262c5 100644 --- a/lib/Service/AutoConfig/ConnectivityTester.php +++ b/lib/Service/AutoConfig/ConnectivityTester.php @@ -26,8 +26,7 @@ namespace OCA\Mail\Service\AutoConfig; use OCP\ILogger; class ConnectivityTester { - - const CONNECTION_TIMEOUT = 5; + public const CONNECTION_TIMEOUT = 5; /** @var ILogger */ protected $logger; @@ -55,5 +54,4 @@ class ConnectivityTester { $this->logger->debug("cannot connect to <$url> on port <$port>"); return false; } - } diff --git a/lib/Service/AutoConfig/ImapConnectivityTester.php b/lib/Service/AutoConfig/ImapConnectivityTester.php index 5c72de91c..b68310f72 100644 --- a/lib/Service/AutoConfig/ImapConnectivityTester.php +++ b/lib/Service/AutoConfig/ImapConnectivityTester.php @@ -96,5 +96,4 @@ class ImapConnectivityTester { } return null; } - } diff --git a/lib/Service/AutoConfig/ImapConnector.php b/lib/Service/AutoConfig/ImapConnector.php index 52c8de0a8..7df5854d6 100644 --- a/lib/Service/AutoConfig/ImapConnector.php +++ b/lib/Service/AutoConfig/ImapConnector.php @@ -72,7 +72,6 @@ class ImapConnector { int $port, string $encryptionProtocol, string $user): MailAccount { - $account = new MailAccount(); $account->setUserId($this->userId); $account->setName($name); @@ -90,5 +89,4 @@ class ImapConnector { $this->logger->info("Test-Account-Successful: $this->userId, $host, $port, $user, $encryptionProtocol"); return $account; } - } diff --git a/lib/Service/AutoConfig/ImapServerDetector.php b/lib/Service/AutoConfig/ImapServerDetector.php index 725383ebf..95edc22bd 100644 --- a/lib/Service/AutoConfig/ImapServerDetector.php +++ b/lib/Service/AutoConfig/ImapServerDetector.php @@ -93,5 +93,4 @@ class ImapServerDetector { $name ); } - } diff --git a/lib/Service/AutoConfig/IspDb.php b/lib/Service/AutoConfig/IspDb.php index 7621f9272..74636f150 100644 --- a/lib/Service/AutoConfig/IspDb.php +++ b/lib/Service/AutoConfig/IspDb.php @@ -130,5 +130,4 @@ class IspDb { } return $provider; } - } diff --git a/lib/Service/AutoConfig/IspDbConfigurationDetector.php b/lib/Service/AutoConfig/IspDbConfigurationDetector.php index f83f34839..e56a60118 100644 --- a/lib/Service/AutoConfig/IspDbConfigurationDetector.php +++ b/lib/Service/AutoConfig/IspDbConfigurationDetector.php @@ -233,5 +233,4 @@ class IspDbConfigurationDetector { } return false; } - } diff --git a/lib/Service/AutoConfig/MxRecord.php b/lib/Service/AutoConfig/MxRecord.php index 209c5787a..037b3f25d 100644 --- a/lib/Service/AutoConfig/MxRecord.php +++ b/lib/Service/AutoConfig/MxRecord.php @@ -43,7 +43,7 @@ class MxRecord { $this->logger->debug("no MX records for host <$host> found"); return false; } - $mxRecords = array_filter($mxRecords, function($record) { + $mxRecords = array_filter($mxRecords, function ($record) { return !empty($record); }); if (empty(($mxRecords))) { @@ -56,5 +56,4 @@ class MxRecord { // TODO: sort by weight return $mxRecords; } - } diff --git a/lib/Service/AutoConfig/SmtpConnectivityTester.php b/lib/Service/AutoConfig/SmtpConnectivityTester.php index 8890ed5f6..40c1af76f 100644 --- a/lib/Service/AutoConfig/SmtpConnectivityTester.php +++ b/lib/Service/AutoConfig/SmtpConnectivityTester.php @@ -137,5 +137,4 @@ class SmtpConnectivityTester { $smtp = $this->clientFactory->create($account); $smtp->getSMTPObject(); } - } diff --git a/lib/Service/AutoConfig/SmtpServerDetector.php b/lib/Service/AutoConfig/SmtpServerDetector.php index c7b3bdbac..67741d228 100644 --- a/lib/Service/AutoConfig/SmtpServerDetector.php +++ b/lib/Service/AutoConfig/SmtpServerDetector.php @@ -85,5 +85,4 @@ class SmtpServerDetector { */ return $this->smtpConnectivityTester->test($account, $host, [$user, $email], $password, true); } - } diff --git a/lib/Service/Avatar/AddressbookSource.php b/lib/Service/Avatar/AddressbookSource.php index f79449279..73a332b2a 100644 --- a/lib/Service/Avatar/AddressbookSource.php +++ b/lib/Service/Avatar/AddressbookSource.php @@ -62,5 +62,4 @@ class AddressbookSource implements IAvatarSource { return $factory->createInternal($url, null); } - } diff --git a/lib/Service/Avatar/Avatar.php b/lib/Service/Avatar/Avatar.php index 8f8b6106b..92340146d 100644 --- a/lib/Service/Avatar/Avatar.php +++ b/lib/Service/Avatar/Avatar.php @@ -83,5 +83,4 @@ class Avatar implements JsonSerializable { 'url' => $this->url, ]; } - } diff --git a/lib/Service/Avatar/AvatarFactory.php b/lib/Service/Avatar/AvatarFactory.php index deda0b604..e3dd2773c 100644 --- a/lib/Service/Avatar/AvatarFactory.php +++ b/lib/Service/Avatar/AvatarFactory.php @@ -48,5 +48,4 @@ class AvatarFactory { public function createExternal(string $url, string $mime): Avatar { return new Avatar($url, $mime); } - } diff --git a/lib/Service/Avatar/Cache.php b/lib/Service/Avatar/Cache.php index 5437e0c13..f52a7f81a 100644 --- a/lib/Service/Avatar/Cache.php +++ b/lib/Service/Avatar/Cache.php @@ -32,7 +32,7 @@ use OCP\ICacheFactory; class Cache { // Cache for one week - const CACHE_TTL = 7 * 24 * 60 * 60; + public const CACHE_TTL = 7 * 24 * 60 * 60; /** @var ICache */ private $cache; @@ -112,5 +112,4 @@ class Cache { public function addImage(string $url, string $uid, string $image): void { $this->cache->set($this->buildImageKey($url, $uid), $image, self::CACHE_TTL); } - } diff --git a/lib/Service/Avatar/CompositeAvatarSource.php b/lib/Service/Avatar/CompositeAvatarSource.php index cd684a9ad..6ce5c7d80 100644 --- a/lib/Service/Avatar/CompositeAvatarSource.php +++ b/lib/Service/Avatar/CompositeAvatarSource.php @@ -69,5 +69,4 @@ class CompositeAvatarSource { return null; } - } diff --git a/lib/Service/Avatar/Downloader.php b/lib/Service/Avatar/Downloader.php index 1c7f4191a..7215648d3 100644 --- a/lib/Service/Avatar/Downloader.php +++ b/lib/Service/Avatar/Downloader.php @@ -53,5 +53,4 @@ class Downloader { return $resp->getBody(); } - } diff --git a/lib/Service/Avatar/FaviconSource.php b/lib/Service/Avatar/FaviconSource.php index cc62a15fd..5fd760702 100644 --- a/lib/Service/Avatar/FaviconSource.php +++ b/lib/Service/Avatar/FaviconSource.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -89,5 +91,4 @@ class FaviconSource implements IAvatarSource { return $factory->createExternal($iconUrl, $mime); } - } diff --git a/lib/Service/Avatar/GravatarSource.php b/lib/Service/Avatar/GravatarSource.php index db75441d9..33ade4569 100644 --- a/lib/Service/Avatar/GravatarSource.php +++ b/lib/Service/Avatar/GravatarSource.php @@ -72,5 +72,4 @@ class GravatarSource implements IAvatarSource { // TODO: check whether it's really always a jpeg return $factory->createExternal($avatarUrl, 'image/jpeg'); } - } diff --git a/lib/Service/AvatarService.php b/lib/Service/AvatarService.php index 11e51c515..657b7c657 100644 --- a/lib/Service/AvatarService.php +++ b/lib/Service/AvatarService.php @@ -149,5 +149,4 @@ class AvatarService implements IAvatarService { return [$avatar, $image]; } - } diff --git a/lib/Service/ContactsIntegration.php b/lib/Service/ContactsIntegration.php index 15efff7dc..cded586ed 100644 --- a/lib/Service/ContactsIntegration.php +++ b/lib/Service/ContactsIntegration.php @@ -117,5 +117,4 @@ class ContactsIntegration { return null; } } - } diff --git a/lib/Service/Group/ContactsGroupService.php b/lib/Service/Group/ContactsGroupService.php index 60e94eabe..169064797 100644 --- a/lib/Service/Group/ContactsGroupService.php +++ b/lib/Service/Group/ContactsGroupService.php @@ -109,7 +109,7 @@ class ContactsGroupService implements IGroupService { if (!is_array($emails)) { $emails = [$emails]; } - foreach($emails as $email) { + foreach ($emails as $email) { $receivers[] = [ 'email' => $email ]; diff --git a/lib/Service/Group/IGroupService.php b/lib/Service/Group/IGroupService.php index 9df81f096..480965059 100644 --- a/lib/Service/Group/IGroupService.php +++ b/lib/Service/Group/IGroupService.php @@ -47,6 +47,4 @@ interface IGroupService { * @return array with group's users as associative arrays */ public function getUsers(string $groupId): array; - } - diff --git a/lib/Service/GroupsIntegration.php b/lib/Service/GroupsIntegration.php index 5ad8714d6..39f00af80 100644 --- a/lib/Service/GroupsIntegration.php +++ b/lib/Service/GroupsIntegration.php @@ -107,5 +107,4 @@ class GroupsIntegration { }, $carry); }, $recipients); } - } diff --git a/lib/Service/Html.php b/lib/Service/Html.php index 3fa3538ee..0703c5de9 100755 --- a/lib/Service/Html.php +++ b/lib/Service/Html.php @@ -153,5 +153,4 @@ class Html { } return $result; } - } diff --git a/lib/Service/HtmlPurify/CidURIScheme.php b/lib/Service/HtmlPurify/CidURIScheme.php index 1c75c515b..4b82a68a5 100644 --- a/lib/Service/HtmlPurify/CidURIScheme.php +++ b/lib/Service/HtmlPurify/CidURIScheme.php @@ -29,7 +29,6 @@ use HTMLPurifier_URI; use HTMLPurifier_URIScheme; class CidURIScheme extends HTMLPurifier_URIScheme { - public $default_port = null; public $browsable = true; public $hierarchical = true; diff --git a/lib/Service/HtmlPurify/TransformHTMLLinks.php b/lib/Service/HtmlPurify/TransformHTMLLinks.php index 8a8dfacc9..b6efa6cae 100755 --- a/lib/Service/HtmlPurify/TransformHTMLLinks.php +++ b/lib/Service/HtmlPurify/TransformHTMLLinks.php @@ -59,5 +59,4 @@ class TransformHTMLLinks extends HTMLPurifier_AttrTransform { return $attr; } - } diff --git a/lib/Service/HtmlPurify/TransformURLScheme.php b/lib/Service/HtmlPurify/TransformURLScheme.php index da0955267..3ec93e73b 100644 --- a/lib/Service/HtmlPurify/TransformURLScheme.php +++ b/lib/Service/HtmlPurify/TransformURLScheme.php @@ -33,7 +33,6 @@ use OCP\IRequest; use OCP\IURLGenerator; class TransformURLScheme extends HTMLPurifier_URIFilter { - public $name = 'TransformURLScheme'; public $post = true; @@ -138,5 +137,4 @@ class TransformURLScheme extends HTMLPurifier_URIFilter { return $uri; } } - } diff --git a/lib/Service/IMailBox.php b/lib/Service/IMailBox.php index 1d6d98646..093e3d7f1 100644 --- a/lib/Service/IMailBox.php +++ b/lib/Service/IMailBox.php @@ -58,5 +58,4 @@ interface IMailBox { * @return array */ public function getStatus(int $flags = Horde_Imap_Client::STATUS_ALL): array; - } diff --git a/lib/Service/ItineraryService.php b/lib/Service/ItineraryService.php index e8207c850..3b5a7a18e 100644 --- a/lib/Service/ItineraryService.php +++ b/lib/Service/ItineraryService.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -87,7 +89,7 @@ class ItineraryService { $this->logger->debug('Message does not have an HTML body, can\'t extract itinerary info'); } $attachments = $this->messageMapper->getRawAttachments($client, $mailbox->getName(), $id); - $itinerary = array_reduce($attachments, function(Itinerary $combined, string $attachment) { + $itinerary = array_reduce($attachments, function (Itinerary $combined, string $attachment) { $extracted = $this->extractor->extract($attachment); $this->logger->debug('Extracted ' . count($extracted) . ' itinerary entries from an attachment'); return $combined->merge($extracted); @@ -102,5 +104,4 @@ class ItineraryService { return $final; } - } diff --git a/lib/Service/MailManager.php b/lib/Service/MailManager.php index 547a312e5..04787ea63 100644 --- a/lib/Service/MailManager.php +++ b/lib/Service/MailManager.php @@ -316,5 +316,4 @@ class MailManager implements IMailManager { ) ); } - } diff --git a/lib/Service/MailTransmission.php b/lib/Service/MailTransmission.php index 537dcebaf..e31d25639 100644 --- a/lib/Service/MailTransmission.php +++ b/lib/Service/MailTransmission.php @@ -357,5 +357,4 @@ class MailTransmission implements IMailTransmission { $message->addAttachmentFromFiles($file); } } - } diff --git a/lib/Service/Provisioning/Config.php b/lib/Service/Provisioning/Config.php index 886e66037..2af2f1827 100644 --- a/lib/Service/Provisioning/Config.php +++ b/lib/Service/Provisioning/Config.php @@ -27,7 +27,6 @@ use JsonSerializable; use OCP\IUser; class Config implements JsonSerializable { - private const VERSION = 1; /** @var mixed[] */ @@ -146,5 +145,4 @@ class Config implements JsonSerializable { $this->data ); } - } diff --git a/lib/Service/Provisioning/ConfigMapper.php b/lib/Service/Provisioning/ConfigMapper.php index 5aef20f8f..2f9b2de31 100644 --- a/lib/Service/Provisioning/ConfigMapper.php +++ b/lib/Service/Provisioning/ConfigMapper.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -27,7 +29,6 @@ use OCA\Mail\AppInfo\Application; use OCP\IConfig; class ConfigMapper { - private const CONFIG_KEY = 'provisioning_settings'; /** @var IConfig */ @@ -58,5 +59,4 @@ class ConfigMapper { return $config; } - } diff --git a/lib/Service/Provisioning/Manager.php b/lib/Service/Provisioning/Manager.php index d0088dbbf..931f9fd94 100644 --- a/lib/Service/Provisioning/Manager.php +++ b/lib/Service/Provisioning/Manager.php @@ -178,5 +178,4 @@ class Manager { // Nothing to update } } - } diff --git a/lib/Service/Search/FilterStringParser.php b/lib/Service/Search/FilterStringParser.php index ad7e314ea..364fb02ac 100644 --- a/lib/Service/Search/FilterStringParser.php +++ b/lib/Service/Search/FilterStringParser.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -26,7 +28,6 @@ namespace OCA\Mail\Service\Search; use Horde_Imap_Client; class FilterStringParser { - private const FLAG_MAP = [ 'answered' => [Horde_Imap_Client::FLAG_ANSWERED, true], 'read' => [Horde_Imap_Client::FLAG_SEEN, true], @@ -85,5 +86,4 @@ class FilterStringParser { return false; } - } diff --git a/lib/Service/Search/MailSearch.php b/lib/Service/Search/MailSearch.php index 9d1d9ab26..6c7c05a66 100644 --- a/lib/Service/Search/MailSearch.php +++ b/lib/Service/Search/MailSearch.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -162,5 +164,4 @@ class MailSearch implements IMailSearch { ); return $this->messageMapper->findUidsByQuery($mailbox, $query, $fromImap); } - } diff --git a/lib/Service/Search/SearchQuery.php b/lib/Service/Search/SearchQuery.php index 560420d90..01e2f6c4c 100644 --- a/lib/Service/Search/SearchQuery.php +++ b/lib/Service/Search/SearchQuery.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -139,5 +141,4 @@ class SearchQuery { public function addTextToken(string $textToken): void { $this->textTokens[] = $textToken; } - } diff --git a/lib/Service/SetupService.php b/lib/Service/SetupService.php index 6ce93d378..fd6eacbdf 100644 --- a/lib/Service/SetupService.php +++ b/lib/Service/SetupService.php @@ -130,7 +130,6 @@ class SetupService { return new Account($newAccount); } - return null; + return null; } - } diff --git a/lib/Service/Sync/ImapToDbSynchronizer.php b/lib/Service/Sync/ImapToDbSynchronizer.php index 178b51319..fe4c7aef1 100644 --- a/lib/Service/Sync/ImapToDbSynchronizer.php +++ b/lib/Service/Sync/ImapToDbSynchronizer.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -48,7 +50,7 @@ use function array_map; class ImapToDbSynchronizer { /** @var int */ - const MAX_NEW_MESSAGES = 5000; + public const MAX_NEW_MESSAGES = 5000; /** @var DatabaseMessageMapper */ private $dbMapper; @@ -301,5 +303,4 @@ class ImapToDbSynchronizer { $this->mailboxMapper->update($mailbox); $perf->end(); } - } diff --git a/lib/Service/Sync/SyncService.php b/lib/Service/Sync/SyncService.php index cfc121e3a..7da0649e5 100644 --- a/lib/Service/Sync/SyncService.php +++ b/lib/Service/Sync/SyncService.php @@ -156,5 +156,4 @@ class SyncService { $vanished ); } - } diff --git a/lib/Service/UserPreferenceSevice.php b/lib/Service/UserPreferenceSevice.php index 330ca42f8..f6881fbc6 100644 --- a/lib/Service/UserPreferenceSevice.php +++ b/lib/Service/UserPreferenceSevice.php @@ -61,5 +61,4 @@ class UserPreferenceSevice implements IUserPreferences { public function getPreference($key, $default = null) { return $this->config->getUserValue($this->UserId, 'mail', $key, $default); } - } diff --git a/lib/Settings/AdminSettings.php b/lib/Settings/AdminSettings.php index 582532471..532749c85 100644 --- a/lib/Settings/AdminSettings.php +++ b/lib/Settings/AdminSettings.php @@ -74,5 +74,4 @@ class AdminSettings implements ISettings { public function getPriority() { return 90; } - } diff --git a/lib/Support/HostNameFactory.php b/lib/Support/HostNameFactory.php index aba0c477c..4107f58b4 100644 --- a/lib/Support/HostNameFactory.php +++ b/lib/Support/HostNameFactory.php @@ -44,5 +44,4 @@ class HostNameFactory { public function getHostName(): string { return Util::getServerHostName(); } - } diff --git a/lib/Support/PerformanceLogger.php b/lib/Support/PerformanceLogger.php index 7043fbb36..56061011f 100644 --- a/lib/Support/PerformanceLogger.php +++ b/lib/Support/PerformanceLogger.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -47,5 +49,4 @@ class PerformanceLogger { $this->logger ); } - } diff --git a/lib/Support/PerformanceLoggerTask.php b/lib/Support/PerformanceLoggerTask.php index 1452f2754..db4866b61 100644 --- a/lib/Support/PerformanceLoggerTask.php +++ b/lib/Support/PerformanceLoggerTask.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -68,5 +70,4 @@ class PerformanceLoggerTask { $this->logger->debug($this->task . " took ${passed}s"); } - } |