Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
SignFileJob
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
2 / 2
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 run
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
2
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\SigningAttemptGuard;
12use OCA\Libresign\Service\SignJobCoordinator;
13use OCP\AppFramework\Utility\ITimeFactory;
14use OCP\BackgroundJob\IJobList;
15
16/** Background job to process file signing asynchronously. */
17class SignFileJob extends RecoverableSigningJob {
18    public function __construct(
19        ITimeFactory $time,
20        private SignJobCoordinator $coordinator,
21        IJobList $jobList,
22        SigningAttemptGuard $attemptGuard,
23    ) {
24        parent::__construct($time, $jobList, $attemptGuard);
25    }
26
27    /** @param array|null $argument */
28    #[\Override]
29    public function run($argument): void {
30        $argument = is_array($argument) ? $argument : [];
31        $this->executeSigning(
32            $argument,
33            fn () => $this->coordinator->runSignFile($argument),
34            fn () => $this->coordinator->discardJobCredentials($argument),
35        );
36    }
37}