| @@ 8-50 (lines=43) @@ | ||
| 5 | use Ramsey\Uuid\UuidInterface; |
|
| 6 | use function DaveRandom\LibLifxLan\datetimeinterface_to_datetimeimmutable; |
|
| 7 | ||
| 8 | final class Group |
|
| 9 | { |
|
| 10 | private $guid; |
|
| 11 | private $label; |
|
| 12 | private $updatedAt; |
|
| 13 | ||
| 14 | private function setGuid(UuidInterface $guid): void |
|
| 15 | { |
|
| 16 | $this->guid = $guid; |
|
| 17 | } |
|
| 18 | ||
| 19 | private function setLabel(Label $label): void |
|
| 20 | { |
|
| 21 | $this->label = $label; |
|
| 22 | } |
|
| 23 | ||
| 24 | private function setUpdatedAt(\DateTimeImmutable $updatedAt): void |
|
| 25 | { |
|
| 26 | $this->updatedAt = $updatedAt; |
|
| 27 | } |
|
| 28 | ||
| 29 | public function __construct(UuidInterface $guid, Label $label, \DateTimeInterface $updatedAt) |
|
| 30 | { |
|
| 31 | $this->setGuid($guid); |
|
| 32 | $this->setLabel($label); |
|
| 33 | $this->setUpdatedAt(datetimeinterface_to_datetimeimmutable($updatedAt)); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function getGuid(): UuidInterface |
|
| 37 | { |
|
| 38 | return $this->guid; |
|
| 39 | } |
|
| 40 | ||
| 41 | public function getLabel(): Label |
|
| 42 | { |
|
| 43 | return $this->label; |
|
| 44 | } |
|
| 45 | ||
| 46 | public function getUpdatedAt(): \DateTimeImmutable |
|
| 47 | { |
|
| 48 | return $this->updatedAt; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 8-50 (lines=43) @@ | ||
| 5 | use Ramsey\Uuid\UuidInterface; |
|
| 6 | use function DaveRandom\LibLifxLan\datetimeinterface_to_datetimeimmutable; |
|
| 7 | ||
| 8 | final class Location |
|
| 9 | { |
|
| 10 | private $guid; |
|
| 11 | private $label; |
|
| 12 | private $updatedAt; |
|
| 13 | ||
| 14 | private function setGuid(UuidInterface $guid): void |
|
| 15 | { |
|
| 16 | $this->guid = $guid; |
|
| 17 | } |
|
| 18 | ||
| 19 | private function setLabel(Label $label): void |
|
| 20 | { |
|
| 21 | $this->label = $label; |
|
| 22 | } |
|
| 23 | ||
| 24 | private function setUpdatedAt(\DateTimeImmutable $updatedAt): void |
|
| 25 | { |
|
| 26 | $this->updatedAt = $updatedAt; |
|
| 27 | } |
|
| 28 | ||
| 29 | public function __construct(UuidInterface $guid, Label $label, \DateTimeInterface $updatedAt) |
|
| 30 | { |
|
| 31 | $this->setGuid($guid); |
|
| 32 | $this->setLabel($label); |
|
| 33 | $this->setUpdatedAt(datetimeinterface_to_datetimeimmutable($updatedAt)); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function getGuid(): UuidInterface |
|
| 37 | { |
|
| 38 | return $this->guid; |
|
| 39 | } |
|
| 40 | ||
| 41 | public function getLabel(): Label |
|
| 42 | { |
|
| 43 | return $this->label; |
|
| 44 | } |
|
| 45 | ||
| 46 | public function getUpdatedAt(): \DateTimeImmutable |
|
| 47 | { |
|
| 48 | return $this->updatedAt; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||