Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| NotificationDeliveryModeResolver | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isAsync | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 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\Service\Notification; |
| 10 | |
| 11 | use OCA\Libresign\Service\Policy\PolicyService; |
| 12 | use OCA\Libresign\Service\Policy\Provider\NotificationDelivery\NotificationDeliveryModePolicy; |
| 13 | |
| 14 | /** Read the dedicated notification policy, independently of signing workers. */ |
| 15 | class NotificationDeliveryModeResolver { |
| 16 | public function __construct( |
| 17 | private PolicyService $policies, |
| 18 | ) { |
| 19 | } |
| 20 | |
| 21 | public function isAsync(): bool { |
| 22 | return $this->policies->resolve(NotificationDeliveryModePolicy::KEY)->getEffectiveValue() |
| 23 | === NotificationDeliveryModePolicy::MODE_ASYNC; |
| 24 | } |
| 25 | } |