Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| AbstractSignatureMethod | |
100.00% |
7 / 7 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| enable | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isEnabled | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toArray | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | /** |
| 5 | * SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors |
| 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
| 7 | */ |
| 8 | |
| 9 | namespace OCA\Libresign\Service\IdentifyMethod\SignatureMethod; |
| 10 | |
| 11 | use OCA\Libresign\Service\IdentifyMethod\AbstractIdentifyMethod; |
| 12 | |
| 13 | abstract class AbstractSignatureMethod extends AbstractIdentifyMethod implements ISignatureMethod { |
| 14 | private bool $enabled = false; |
| 15 | |
| 16 | #[\Override] |
| 17 | public function enable(): void { |
| 18 | $this->enabled = true; |
| 19 | } |
| 20 | |
| 21 | #[\Override] |
| 22 | public function isEnabled(): bool { |
| 23 | return $this->enabled; |
| 24 | } |
| 25 | |
| 26 | #[\Override] |
| 27 | public function toArray(): array { |
| 28 | return [ |
| 29 | 'label' => $this->getFriendlyName(), |
| 30 | 'name' => $this->getName(), |
| 31 | 'enabled' => $this->isEnabled(), |
| 32 | ]; |
| 33 | } |
| 34 | } |