Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Drupal\name\Service; |
| 6 | |
| 7 | /** |
| 8 | * Options and patterns from name_format and name_list_format config entities. |
| 9 | * |
| 10 | * @internal |
| 11 | */ |
| 12 | interface FormatOptionInterface { |
| 13 | |
| 14 | /** |
| 15 | * Returns sort options for custom name_format entities. |
| 16 | * |
| 17 | * @return array<string, string> |
| 18 | * Machine name keyed labels. |
| 19 | */ |
| 20 | public function getCustomFormatOptions(): array; |
| 21 | |
| 22 | /** |
| 23 | * Returns sort options for custom name_list_format entities. |
| 24 | * |
| 25 | * @return array<string, string> |
| 26 | * Machine name keyed labels. |
| 27 | */ |
| 28 | public function getCustomListFormatOptions(): array; |
| 29 | |
| 30 | /** |
| 31 | * Coerces legacy / untyped format ids for config entity load(). |
| 32 | * |
| 33 | * For deprecated helpers and theme preprocess only. Accepts scalars and |
| 34 | * \\Stringable that stringify to non-empty text; otherwise NULL. |
| 35 | * |
| 36 | * @param mixed $raw |
| 37 | * A machine name from legacy callers or theme variables. |
| 38 | * |
| 39 | * @return string|null |
| 40 | * Non-empty machine name, or NULL when load() should not run. |
| 41 | */ |
| 42 | public static function normalizeLegacyFormatMachineName(mixed $raw): ?string; |
| 43 | |
| 44 | /** |
| 45 | * Loads a format pattern by machine name. |
| 46 | */ |
| 47 | public function getFormatPatternByMachineName(string $machine_name): ?string; |
| 48 | |
| 49 | } |