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