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 | * Parses name component arrays into formatted strings. |
| 9 | */ |
| 10 | interface NameFormatParserInterface { |
| 11 | |
| 12 | /** |
| 13 | * Parses a name component array into the given format. |
| 14 | * |
| 15 | * @param array<string, mixed> $name_components |
| 16 | * Keyed array of name components. |
| 17 | * @param string $format |
| 18 | * The name format pattern to generate the name. |
| 19 | * @param array<string, mixed> $settings |
| 20 | * Parser settings (sep1, sep2, sep3, markup). |
| 21 | * |
| 22 | * @return mixed |
| 23 | * Renderable output per markup mode. |
| 24 | */ |
| 25 | public function parse(array $name_components, string $format = '', array $settings = []): mixed; |
| 26 | |
| 27 | /** |
| 28 | * Supported markup options. |
| 29 | * |
| 30 | * @return array<string, \Drupal\Core\StringTranslation\TranslatableMarkup|string> |
| 31 | * Keyed markup options. |
| 32 | */ |
| 33 | public function getMarkupOptions(): array; |
| 34 | |
| 35 | /** |
| 36 | * Supported format tokens. |
| 37 | * |
| 38 | * @param bool $describe |
| 39 | * Appends the description of the letter to the description. |
| 40 | * |
| 41 | * @return array<string, \Drupal\Core\StringTranslation\TranslatableMarkup|string> |
| 42 | * Tokens keyed by letter. |
| 43 | */ |
| 44 | public function tokenHelp(bool $describe = TRUE): array; |
| 45 | |
| 46 | /** |
| 47 | * Renderable array of format token help. |
| 48 | * |
| 49 | * @return array<string, mixed> |
| 50 | * A render array. |
| 51 | */ |
| 52 | public function renderableTokenHelp(): array; |
| 53 | |
| 54 | } |