Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
DeliverNotification
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
30
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 run
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
20
1<?php
2
3declare(strict_types=1);
4/**
5 * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
6 * SPDX-License-Identifier: AGPL-3.0-or-later
7 */
8
9namespace OCA\Libresign\BackgroundJob;
10
11use OCA\Libresign\Service\Notification\NotificationDeliveryProcessor;
12use OCP\AppFramework\Utility\ITimeFactory;
13use OCP\BackgroundJob\QueuedJob;
14
15/** A job stores only the durable delivery ID, never message content. */
16final class DeliverNotification extends QueuedJob {
17    public function __construct(
18        ITimeFactory $time,
19        private NotificationDeliveryProcessor $processor,
20    ) {
21        parent::__construct($time);
22    }
23
24    #[\Override]
25    public function run($argument): void {
26        if (!is_array($argument) || !isset($argument['id']) || (int)$argument['id'] <= 0) {
27            return;
28        }
29        $this->processor->process((int)$argument['id']);
30    }
31}