| Total Complexity | 5 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | final class BootstrapPayload implements JsonPayloadInterface |
||
| 9 | { |
||
| 10 | /** @var AentItemRegistry */ |
||
| 11 | private $CIAent; |
||
| 12 | |||
| 13 | /** @var array<string,string> */ |
||
| 14 | private $CIMetadata; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * BootstrapPayload constructor. |
||
| 18 | * @param AentItemRegistry $CIAent |
||
| 19 | * @param array<string,string> $CIMetadata |
||
| 20 | */ |
||
| 21 | public function __construct(AentItemRegistry $CIAent, array $CIMetadata) |
||
| 22 | { |
||
| 23 | $this->CIAent = $CIAent; |
||
| 24 | $this->CIMetadata = $CIMetadata; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return mixed[] |
||
| 29 | */ |
||
| 30 | public function toArray(): array |
||
| 31 | { |
||
| 32 | return [ |
||
| 33 | 'CI_AENT' => $this->CIAent->toArray(), |
||
| 34 | 'CI_METADATA' => $this->CIMetadata, |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param mixed[] $assoc |
||
| 40 | * @return self |
||
| 41 | */ |
||
| 42 | public static function fromArray(array $assoc): self |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return AentItemRegistry |
||
| 51 | */ |
||
| 52 | public function getCIAent(): AentItemRegistry |
||
| 53 | { |
||
| 54 | return $this->CIAent; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return array<string,string> |
||
| 59 | */ |
||
| 60 | public function getCIMetadata(): array |
||
| 63 | } |
||
| 64 | } |
||
| 65 |