Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| DeliverNotification | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
30 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| run | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
20 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | /** |
| 5 | * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors |
| 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
| 7 | */ |
| 8 | |
| 9 | namespace OCA\Libresign\BackgroundJob; |
| 10 | |
| 11 | use OCA\Libresign\Service\Notification\NotificationDeliveryProcessor; |
| 12 | use OCP\AppFramework\Utility\ITimeFactory; |
| 13 | use OCP\BackgroundJob\QueuedJob; |
| 14 | |
| 15 | /** A job stores only the durable delivery ID, never message content. */ |
| 16 | final 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 | } |