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