Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ class Address implements JsonSerializable {
public const TYPE_CC = 2;
public const TYPE_BCC = 3;

/** @var Horde_Mail_Rfc822_Address */
private $wrapped;

private function __construct(Horde_Mail_Rfc822_Address $wrapped) {
$this->wrapped = $wrapped;
private function __construct(
private Horde_Mail_Rfc822_Address $wrapped,
) {
}

public static function fromHorde(Horde_Mail_Rfc822_Address $horde): self {
Expand Down
8 changes: 3 additions & 5 deletions lib/AddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
* @psalm-immutable
*/
class AddressList implements Countable, JsonSerializable {
/** @var list<Address> */
private array $addresses;

/**
* @param list<Address> $addresses
*/
public function __construct(array $addresses = []) {
$this->addresses = $addresses;
public function __construct(
private array $addresses = [],
) {
}

/**
Expand Down
21 changes: 5 additions & 16 deletions lib/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,15 @@
use Horde_Mime_Part;

class Attachment {
private ?string $id;
private ?string $name;
private string $type;
private string $content;
private int $size;

public function __construct(
?string $id,
?string $name,
string $type,
string $content,
int $size,
private ?string $id,
private ?string $name,
private string $type,
private string $content,
private int $size,
public readonly ?string $contentId,
public readonly ?string $disposition,
) {
$this->id = $id;
$this->name = $name;
$this->type = $type;
$this->content = $content;
$this->size = $size;
}

public static function fromMimePart(Horde_Mime_Part $mimePart): self {
Expand Down
13 changes: 5 additions & 8 deletions lib/BackgroundJob/CleanupJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
use Psr\Log\LoggerInterface;

class CleanupJob extends TimedJob {
private CleanupService $cleanupService;
private LoggerInterface $logger;

public function __construct(ITimeFactory $time,
CleanupService $cleanupService,
LoggerInterface $logger) {
public function __construct(
ITimeFactory $time,
private CleanupService $cleanupService,
private LoggerInterface $logger,
) {
parent::__construct($time);
$this->cleanupService = $cleanupService;
$this->logger = $logger;

$this->setInterval(24 * 60 * 60);
$this->setTimeSensitivity(self::TIME_INSENSITIVE);
Expand Down
9 changes: 4 additions & 5 deletions lib/BackgroundJob/DraftsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
use OCP\BackgroundJob\TimedJob;

class DraftsJob extends TimedJob {
private DraftsService $draftsService;

public function __construct(ITimeFactory $time,
DraftsService $draftsService) {
public function __construct(
ITimeFactory $time,
private DraftsService $draftsService,
) {
parent::__construct($time);

// Run once per five minutes
$this->setInterval(5 * 60);
$this->setTimeSensitivity(self::TIME_SENSITIVE);
$this->draftsService = $draftsService;
}

#[\Override]
Expand Down
9 changes: 4 additions & 5 deletions lib/BackgroundJob/IMipMessageJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
use OCP\BackgroundJob\TimedJob;

class IMipMessageJob extends TimedJob {
private IMipService $iMipService;

public function __construct(ITimeFactory $time,
IMipService $iMipService) {
public function __construct(
ITimeFactory $time,
private IMipService $iMipService,
) {
parent::__construct($time);

$this->setInterval(300);
$this->iMipService = $iMipService;
}

#[\Override]
Expand Down
26 changes: 7 additions & 19 deletions lib/BackgroundJob/MigrateImportantJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,16 @@
use Psr\Log\LoggerInterface;

class MigrateImportantJob extends QueuedJob {
private MailboxMapper $mailboxMapper;
private MailAccountMapper $mailAccountMapper;
private MailManager $mailManager;
private MigrateImportantFromImapAndDb $migration;
private LoggerInterface $logger;
private IMAPClientFactory $imapClientFactory;

public function __construct(MailboxMapper $mailboxMapper,
MailAccountMapper $mailAccountMapper,
MailManager $mailManager,
MigrateImportantFromImapAndDb $migration,
LoggerInterface $logger,
public function __construct(
private MailboxMapper $mailboxMapper,
private MailAccountMapper $mailAccountMapper,
private MailManager $mailManager,
private MigrateImportantFromImapAndDb $migration,
private LoggerInterface $logger,
ITimeFactory $timeFactory,
IMAPClientFactory $imapClientFactory,
private IMAPClientFactory $imapClientFactory,
) {
parent::__construct($timeFactory);
$this->mailboxMapper = $mailboxMapper;
$this->mailAccountMapper = $mailAccountMapper;
$this->mailManager = $mailManager;
$this->migration = $migration;
$this->logger = $logger;
$this->imapClientFactory = $imapClientFactory;
}

/**
Expand Down
9 changes: 4 additions & 5 deletions lib/BackgroundJob/OutboxWorkerJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
use OCP\BackgroundJob\TimedJob;

class OutboxWorkerJob extends TimedJob {
private OutboxService $outboxService;

public function __construct(ITimeFactory $time,
OutboxService $outboxService) {
public function __construct(
ITimeFactory $time,
private OutboxService $outboxService,
) {
parent::__construct($time);

// Run once per five minutes
$this->setInterval(5 * 60);
$this->setTimeSensitivity(self::TIME_SENSITIVE);
$this->outboxService = $outboxService;
}

#[\Override]
Expand Down
18 changes: 7 additions & 11 deletions lib/BackgroundJob/PreviewEnhancementProcessingJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,20 @@

class PreviewEnhancementProcessingJob extends TimedJob {
private IUserManager $userManager;
private AccountService $accountService;
private LoggerInterface $logger;
private IJobList $jobList;
private PreprocessingService $preprocessingService;

public function __construct(ITimeFactory $time,
public function __construct(
ITimeFactory $time,
IUserManager $userManager,
AccountService $accountService,
PreprocessingService $preprocessingService,
LoggerInterface $logger,
IJobList $jobList) {
private AccountService $accountService,
private PreprocessingService $preprocessingService,
private LoggerInterface $logger,
IJobList $jobList,
) {
parent::__construct($time);

$this->userManager = $userManager;
$this->accountService = $accountService;
$this->logger = $logger;
$this->jobList = $jobList;
$this->preprocessingService = $preprocessingService;

$this->setInterval(3600);
$this->setTimeSensitivity(self::TIME_SENSITIVE);
Expand Down
18 changes: 7 additions & 11 deletions lib/BackgroundJob/QuotaJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,22 @@

class QuotaJob extends TimedJob {
private IUserManager $userManager;
private AccountService $accountService;
private IMailManager $mailManager;
private LoggerInterface $logger;
private IJobList $jobList;
private IManager $notificationManager;

public function __construct(ITimeFactory $time,
public function __construct(
ITimeFactory $time,
IUserManager $userManager,
AccountService $accountService,
IMailManager $mailManager,
private AccountService $accountService,
private IMailManager $mailManager,
IManager $notificationManager,
LoggerInterface $logger,
IJobList $jobList) {
private LoggerInterface $logger,
IJobList $jobList,
) {
parent::__construct($time);

$this->userManager = $userManager;
$this->accountService = $accountService;
$this->logger = $logger;
$this->jobList = $jobList;
$this->mailManager = $mailManager;

$this->setInterval(60 * 60 * 24 * 7);
$this->setTimeSensitivity(self::TIME_INSENSITIVE);
Expand Down
16 changes: 4 additions & 12 deletions lib/BackgroundJob/SyncJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,22 @@ class SyncJob extends TimedJob {
private const DEFAULT_SYNC_INTERVAL = 3600;

private IUserManager $userManager;
private AccountService $accountService;
private ImapToDbSynchronizer $syncService;
private MailboxSync $mailboxSync;
private LoggerInterface $logger;
private IJobList $jobList;
private readonly bool $forcedSyncInterval;

public function __construct(
ITimeFactory $time,
IUserManager $userManager,
AccountService $accountService,
MailboxSync $mailboxSync,
ImapToDbSynchronizer $syncService,
LoggerInterface $logger,
private AccountService $accountService,
private MailboxSync $mailboxSync,
private ImapToDbSynchronizer $syncService,
private LoggerInterface $logger,
IJobList $jobList,
private readonly IConfig $config,
) {
parent::__construct($time);

$this->userManager = $userManager;
$this->accountService = $accountService;
$this->syncService = $syncService;
$this->mailboxSync = $mailboxSync;
$this->logger = $logger;
$this->jobList = $jobList;

$configuredSyncInterval = $config->getSystemValueInt('app.mail.background-sync-interval');
Expand Down
17 changes: 6 additions & 11 deletions lib/BackgroundJob/TrainImportanceClassifierJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,17 @@
use Throwable;

class TrainImportanceClassifierJob extends TimedJob {
private AccountService $accountService;
private ImportanceClassifier $classifier;
private IJobList $jobList;
private LoggerInterface $logger;

public function __construct(ITimeFactory $time,
AccountService $accountService,
ImportanceClassifier $classifier,
public function __construct(
ITimeFactory $time,
private AccountService $accountService,
private ImportanceClassifier $classifier,
IJobList $jobList,
LoggerInterface $logger) {
private LoggerInterface $logger,
) {
parent::__construct($time);

$this->accountService = $accountService;
$this->classifier = $classifier;
$this->jobList = $jobList;
$this->logger = $logger;

$this->setInterval(24 * 60 * 60);
$this->setTimeSensitivity(self::TIME_INSENSITIVE);
Expand Down
16 changes: 5 additions & 11 deletions lib/Command/AddMissingTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@
final class AddMissingTags extends Command {
public const ARGUMENT_ACCOUNT_ID = 'account-id';

private LoggerInterface $logger;
private TagMapper $tagMapper;
private MailAccountMapper $mapper;

public function __construct(MailAccountMapper $mapper,
TagMapper $tagMapper,
LoggerInterface $logger) {
public function __construct(
private MailAccountMapper $mapper,
private TagMapper $tagMapper,
private LoggerInterface $logger,
) {
parent::__construct();

$this->mapper = $mapper;
$this->tagMapper = $tagMapper;
$this->logger = $logger;
}

/**
Expand Down
12 changes: 4 additions & 8 deletions lib/Command/CleanUp.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@
use Symfony\Component\Console\Output\OutputInterface;

final class CleanUp extends Command {
private CleanupService $cleanupService;
private LoggerInterface $logger;

public function __construct(CleanupService $cleanupService,
LoggerInterface $logger) {
public function __construct(
private CleanupService $cleanupService,
private LoggerInterface $logger,
) {
parent::__construct();

$this->cleanupService = $cleanupService;
$this->logger = $logger;
}

/**
Expand Down
6 changes: 1 addition & 5 deletions lib/Command/CreateAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,16 @@ final class CreateAccount extends Command {
public const ARGUMENT_SMTP_SSL_MODE = 'smtp-ssl-mode';
public const ARGUMENT_SMTP_USER = 'smtp-user';
public const ARGUMENT_SMTP_PASSWORD = 'smtp-password';

private AccountService $accountService;
private ICrypto $crypto;
private IUserManager $userManager;

public function __construct(
AccountService $service,
private AccountService $accountService,
ICrypto $crypto,
IUserManager $userManager,
private ClassificationSettingsService $classificationSettingsService,
) {
parent::__construct();

$this->accountService = $service;
$this->crypto = $crypto;
$this->userManager = $userManager;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Command/CreateTagMigrationJobEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

final class CreateTagMigrationJobEntry extends Command {
private JobList $jobList;
private MailboxMapper $mailboxMapper;

public function __construct(JobList $jobList,
MailboxMapper $mailboxMapper) {
public function __construct(
JobList $jobList,
private MailboxMapper $mailboxMapper,
) {
parent::__construct();
$this->jobList = $jobList;
$this->mailboxMapper = $mailboxMapper;
}

protected function configure(): void {
Expand Down
Loading
Loading