| Total Complexity | 2 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | final class TelephoneNumber extends AbstractMdElement implements |
||
| 25 | ArrayizableElementInterface, |
||
| 26 | SchemaValidatableElementInterface |
||
| 27 | { |
||
| 28 | use SchemaValidatableElementTrait; |
||
| 29 | use TypedTextContentTrait; |
||
|
|
|||
| 30 | |||
| 31 | /** @var string */ |
||
| 32 | public const TEXTCONTENT_TYPE = SAMLStringValue::class; |
||
| 33 | |||
| 34 | |||
| 35 | /** |
||
| 36 | * Create a class from an array |
||
| 37 | * |
||
| 38 | * @param array $data |
||
| 39 | * @return static |
||
| 40 | */ |
||
| 41 | public static function fromArray(array $data): static |
||
| 42 | { |
||
| 43 | Assert::allString($data, ArrayValidationException::class); |
||
| 44 | |||
| 45 | $index = array_key_first($data); |
||
| 46 | return new static( |
||
| 47 | SAMLStringValue::fromString($data[$index]), |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 51 | |||
| 52 | /** |
||
| 53 | * Create an array from this class |
||
| 54 | * |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | public function toArray(): array |
||
| 60 | } |
||
| 61 | } |
||
| 62 |