Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove unnecessary var annotations #10922

Merged
merged 1 commit into from
Apr 3, 2025
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
2 changes: 0 additions & 2 deletions lib/BackgroundJob/QuotaJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace OCA\Mail\BackgroundJob;

use OCA\Mail\Account;
use OCA\Mail\Contracts\IMailManager;
use OCA\Mail\Service\AccountService;
use OCP\AppFramework\Db\DoesNotExistException;
Expand Down Expand Up @@ -54,7 +53,6 @@ public function __construct(ITimeFactory $time,
protected function run($argument): void {
$accountId = (int)$argument['accountId'];
try {
/** @var Account $account */
$account = $this->accountService->findById($accountId);
} catch (DoesNotExistException $e) {
$this->logger->debug('Could not find account <' . $accountId . '> removing from jobs');
Expand Down
1 change: 0 additions & 1 deletion lib/IMAP/MailboxSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ private function isMailboxShared(?Horde_Imap_Client_Namespace_List $namespaces,
private function syncMailboxStatus(mixed $mailboxes, ?string $personalNamespace, \Horde_Imap_Client_Socket $client): void {
/** @var array{0: Mailbox[], 1: Mailbox[]} */
[$sync, $doNotSync] = array_reduce($mailboxes, function (array $carry, Mailbox $mailbox) use ($personalNamespace): array {
/** @var array{0: Mailbox[], 1: Mailbox[]} $carry */
[$sync, $doNotSync] = $carry;
$inboxName = $personalNamespace === null ? 'INBOX' : ($personalNamespace . $mailbox->getDelimiter() . 'INBOX');
if ($inboxName === $mailbox->getName() || $mailbox->getSyncInBackground()) {
Expand Down
2 changes: 0 additions & 2 deletions lib/Listener/NewMessagesNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace OCA\Mail\Listener;

use OCA\Mail\Db\Message;
use OCA\Mail\Events\NewMessageReceivedEvent;
use OCA\Mail\Events\NewMessagesSynchronized;
use OCP\EventDispatcher\Event;
Expand All @@ -34,7 +33,6 @@ public function handle(Event $event): void {
return;
}

/** @var Message $message */
foreach ($event->getMessages() as $message) {
$uri = $this->urlGenerator->linkToOCSRouteAbsolute('mail.messageApi.get', ['id' => $message->getId()]);
$this->eventDispatcher->dispatchTyped(new NewMessageReceivedEvent($uri));
Expand Down
2 changes: 0 additions & 2 deletions lib/Migration/FixBackgroundJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use OCA\Mail\BackgroundJob\RepairSyncJob;
use OCA\Mail\BackgroundJob\SyncJob;
use OCA\Mail\BackgroundJob\TrainImportanceClassifierJob;
use OCA\Mail\Db\MailAccount;
use OCA\Mail\Db\MailAccountMapper;
use OCP\BackgroundJob\IJobList;
use OCP\Migration\IOutput;
Expand All @@ -38,7 +37,6 @@ public function getName(): string {
* @return void
*/
public function run(IOutput $output) {
/** @var MailAccount[] $accounts */
$accounts = $this->mapper->getAllAccounts();

$output->startProgress(count($accounts));
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3001Date20230307113544.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

class Version3001Date20230307113544 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$accountsTable = $schema->getTable('mail_accounts');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3300Date20230706140531.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Version3300Date20230706140531 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$accountsTable = $schema->getTable('mail_accounts');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3300Date20230801124717.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Version3300Date20230801124717 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$accountsTable = $schema->getTable('mail_accounts');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3400Date20230807300513.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Version3400Date20230807300513 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$accountsTable = $schema->getTable('mail_accounts');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3400Date20230814160451.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Version3400Date20230814160451 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$accountsTable = $schema->getTable('mail_accounts');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3400Date20230818160236.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Version3400Date20230818160236 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$snoozeTable = $schema->getTable('mail_messages_snoozed');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3400Date20230819161945.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Version3400Date20230819161945 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$messagesRetentionTable = $schema->getTable('mail_messages_retention');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3400Date20230823153943.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Version3400Date20230823153943 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$messagesSnoozedTable = $schema->getTable('mail_messages_snoozed');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3400Date20230907103114.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $
}

public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$retentionTable = $schema->getTable('mail_messages_retention');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3500Date20231009102414.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Version3500Date20231009102414 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$mailAccountsTable = $schema->getTable('mail_accounts');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3500Date20231114180656.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Version3500Date20231114180656 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$accountsTable = $schema->getTable('mail_accounts');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3500Date20231115182612.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function __construct(
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$mailboxesTable = $schema->getTable('mail_mailboxes');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3500Date20231115184458.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Version3500Date20231115184458 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$mailboxesTable = $schema->getTable('mail_mailboxes');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3600Date20240205180726.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Version3600Date20240205180726 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$mailboxesTable = $schema->getTable('mail_messages');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3600Date20240220134813.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Version3600Date20240220134813 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$localMessagesTable = $schema->getTable('mail_local_messages');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3700Date20240430115406.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function __construct(
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$localMessagesTable = $schema->getTable('mail_local_messages');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3700Date20240506161400.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Version3700Date20240506161400 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$localMessagesTable = $schema->getTable('mail_local_messages');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version3800Date20240628163133.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function __construct(
}

public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$accounts = $schema->getTable('mail_accounts');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version4000Date20240716172702.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Version4000Date20240716172702 extends SimpleMigrationStep {
* @return ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

if (!$schema->hasTable('mail_internal_address')) {
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version4001Date20241009140707.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Version4001Date20241009140707 extends SimpleMigrationStep {
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {

/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$messagesTable = $schema->getTable('mail_messages');
Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version4100Date20241021091352.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Version4100Date20241021091352 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

if ($schema->hasTable('mail_classifiers')) {
Expand Down
1 change: 0 additions & 1 deletion lib/Service/HtmlPurify/TransformURLScheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public function __construct(array $messageParameters,
* @return bool
*/
public function filter(&$uri, $config, $context) {
/** @var \HTMLPurifier_Context $context */

if ($uri->scheme === null) {
$uri->scheme = 'https';
Expand Down