Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
10 / 10 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| SignRequestCanceledEvent | |
100.00% |
10 / 10 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getDeliveryEventId | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
| getLibreSignFile | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSignRequest | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getIdentifyMethod | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | /** |
| 5 | * SPDX-FileCopyrightText: 2025 LibreCode coop and contributors |
| 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
| 7 | */ |
| 8 | |
| 9 | namespace OCA\Libresign\Events; |
| 10 | |
| 11 | use OCA\Libresign\Db\File as FileEntity; |
| 12 | use OCA\Libresign\Db\SignRequest; |
| 13 | use OCA\Libresign\Service\IdentifyMethod\IIdentifyMethod; |
| 14 | use OCP\EventDispatcher\Event; |
| 15 | |
| 16 | class SignRequestCanceledEvent extends Event { |
| 17 | public const SIGN_REQUEST_CANCELED = 'libresign_sign_request_canceled'; |
| 18 | |
| 19 | public function __construct( |
| 20 | private SignRequest $signRequest, |
| 21 | private FileEntity $libreSignFile, |
| 22 | private IIdentifyMethod $identifyMethod, |
| 23 | ) { |
| 24 | } |
| 25 | |
| 26 | public function getDeliveryEventId(): string { |
| 27 | return sprintf( |
| 28 | 'canceled:%d:%d:%d', |
| 29 | $this->libreSignFile->getId(), |
| 30 | $this->signRequest->getId(), |
| 31 | $this->identifyMethod->getEntity()->getId() ?? 0, |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | public function getLibreSignFile(): FileEntity { |
| 36 | return $this->libreSignFile; |
| 37 | } |
| 38 | |
| 39 | public function getSignRequest(): SignRequest { |
| 40 | return $this->signRequest; |
| 41 | } |
| 42 | |
| 43 | public function getIdentifyMethod(): IIdentifyMethod { |
| 44 | return $this->identifyMethod; |
| 45 | } |
| 46 | } |