From a52e2e198708cf3e24eda73cbbc5906593cc730a Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 18 Jul 2020 15:49:06 +0400 Subject: Added DateTime of channel entity Signed-off-by: Valentin Popov --- src/Entities/ChannelEntity.php | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/Entities/ChannelEntity.php') diff --git a/src/Entities/ChannelEntity.php b/src/Entities/ChannelEntity.php index 0d8d3fc..4881722 100644 --- a/src/Entities/ChannelEntity.php +++ b/src/Entities/ChannelEntity.php @@ -19,21 +19,22 @@ declare(strict_types = 1); namespace EPGService\Entities; +use DateTime; use RuntimeException; use function is_string; /** - * @property-read string $base_id - * @property-read string $base_name - * @property-read string $epg_id - * @property-read string $geo_data - * @property-read string $href - * @property-read string $icon - * @property-read string $id - * @property-read string $lang - * @property-read string $name - * @property-read string $update_at - * @property-read string $week + * @property-read string $base_id + * @property-read string $base_name + * @property-read string $epg_id + * @property-read string $geo_data + * @property-read string $href + * @property-read string $icon + * @property-read string $id + * @property-read string $lang + * @property-read string $name + * @property-read \DateTime $update_at + * @property-read string $week * * @copyright Copyright © 2020 “Valentin Popov” * @license http://www.apache.org/licenses/LICENSE-2.0 @@ -86,9 +87,9 @@ final class ChannelEntity { private string $name; /** - * @var string + * @var \DateTime */ - private string $update_at; + private DateTime $update_at; /** * @var string @@ -156,7 +157,7 @@ final class ChannelEntity { throw new RuntimeException('blah-blah-blah'); } - if (!is_string($payload['update_at'])) { + if (!$payload['update_at'] instanceof DateTime) { throw new RuntimeException('blah-blah-blah'); } -- cgit v1.2.3