| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace CBOR; |
| 6 | |
| 7 | class MapItem |
| 8 | { |
| 9 | public function __construct( |
| 10 | private CBORObject $key, |
| 11 | private CBORObject $value |
| 12 | ) { |
| 13 | } |
| 14 | |
| 15 | public static function create(CBORObject $key, CBORObject $value): self |
| 16 | { |
| 17 | return new self($key, $value); |
| 18 | } |
| 19 | |
| 20 | public function getKey(): CBORObject |
| 21 | { |
| 22 | return $this->key; |
| 23 | } |
| 24 | |
| 25 | public function getValue(): CBORObject |
| 26 | { |
| 27 | return $this->value; |
| 28 | } |
| 29 | } |