Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| PolicyKeyNormalizer | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| normalize | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| 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\Policy\Provider\Helper; |
| 10 | |
| 11 | final class PolicyKeyNormalizer { |
| 12 | public static function normalize(string|\BackedEnum $policyKey): string { |
| 13 | if ($policyKey instanceof \BackedEnum) { |
| 14 | return (string)$policyKey->value; |
| 15 | } |
| 16 | |
| 17 | return $policyKey; |
| 18 | } |
| 19 | } |