diff --git a/src/Model/Starship.php b/src/Model/Starship.php index 728a875..f2db3f7 100644 --- a/src/Model/Starship.php +++ b/src/Model/Starship.php @@ -12,6 +12,7 @@ class Starship private string $class, private string $captain, private StarshipStatusEnum $status, + private \DateTimeImmutable $arrivedAt, ) { } @@ -53,4 +54,9 @@ class Starship StarshipStatusEnum::COMPLETED => '/images/status-complete.png', }; } + + public function getArrivedAt(): \DateTimeImmutable + { + return $this->arrivedAt; + } } diff --git a/src/Repository/StarshipRepository.php b/src/Repository/StarshipRepository.php index b2a3f8d..0b3d78a 100644 --- a/src/Repository/StarshipRepository.php +++ b/src/Repository/StarshipRepository.php @@ -17,18 +17,18 @@ class StarshipRepository $this->logger->info('Starship Repository: Finding Starships'); return [ - new Starship(1, 'Starship 01', 'Heavy Starship', 'Human Captain', StarshipStatusEnum::COMPLETED), - new Starship(2, 'Starship 02', 'Light Starship', 'Robot Captain', StarshipStatusEnum::IN_PROGRESS), - new Starship(3, 'USS Voyager', 'Intrepid', 'Kathryn Janeway', StarshipStatusEnum::WAITING), - new Starship(4, 'Starblade', 'Interceptor', 'Lance Stellar', StarshipStatusEnum::COMPLETED), - new Starship(5, 'Black Star', 'Battlecruiser', 'Zara Nox', StarshipStatusEnum::WAITING), - new Starship(6, 'SS Horizon', 'Explorer', 'James Marshall', StarshipStatusEnum::COMPLETED), - new Starship(7, 'Nebula Queen', 'Transport', 'Elara Trent', StarshipStatusEnum::IN_PROGRESS), - new Starship(8, 'Celestial Wave', 'Frigate', 'Talon Skye', StarshipStatusEnum::IN_PROGRESS), - new Starship(9, 'Galactic Serpent', 'Destroyer', 'Viktor Helios', StarshipStatusEnum::COMPLETED), - new Starship(10, 'Phoenix Wing', 'Carrier', 'Aurora Drake', StarshipStatusEnum::COMPLETED), - new Starship(11, 'Silver Comet', 'Scout', 'Finn O\'Neil', StarshipStatusEnum::WAITING), - new Starship(12, 'Crimson Spear', 'Corvette', 'Raven Callen', StarshipStatusEnum::IN_PROGRESS), + new Starship(1, 'Starship 01', 'Heavy Starship', 'Human Captain', StarshipStatusEnum::COMPLETED, new \DateTimeImmutable()), + new Starship(2, 'Starship 02', 'Light Starship', 'Robot Captain', StarshipStatusEnum::IN_PROGRESS, new \DateTimeImmutable()), + new Starship(3, 'USS Voyager', 'Intrepid', 'Kathryn Janeway', StarshipStatusEnum::WAITING, new \DateTimeImmutable()), + new Starship(4, 'Starblade', 'Interceptor', 'Lance Stellar', StarshipStatusEnum::COMPLETED, new \DateTimeImmutable()), + new Starship(5, 'Black Star', 'Battlecruiser', 'Zara Nox', StarshipStatusEnum::WAITING, new \DateTimeImmutable()), + new Starship(6, 'SS Horizon', 'Explorer', 'James Marshall', StarshipStatusEnum::COMPLETED, new \DateTimeImmutable()), + new Starship(7, 'Nebula Queen', 'Transport', 'Elara Trent', StarshipStatusEnum::IN_PROGRESS, new \DateTimeImmutable()), + new Starship(8, 'Celestial Wave', 'Frigate', 'Talon Skye', StarshipStatusEnum::IN_PROGRESS, new \DateTimeImmutable()), + new Starship(9, 'Galactic Serpent', 'Destroyer', 'Viktor Helios', StarshipStatusEnum::COMPLETED, new \DateTimeImmutable()), + new Starship(10, 'Phoenix Wing', 'Carrier', 'Aurora Drake', StarshipStatusEnum::COMPLETED, new \DateTimeImmutable()), + new Starship(11, 'Silver Comet', 'Scout', 'Finn O\'Neil', StarshipStatusEnum::WAITING, new \DateTimeImmutable()), + new Starship(12, 'Crimson Spear', 'Corvette', 'Raven Callen', StarshipStatusEnum::IN_PROGRESS, new \DateTimeImmutable()), ]; } diff --git a/templates/main/homepage.html.twig b/templates/main/homepage.html.twig index 797ca8d..8723e4b 100644 --- a/templates/main/homepage.html.twig +++ b/templates/main/homepage.html.twig @@ -28,6 +28,9 @@ href="{{ path('app_starship_show', {id: ship.id}) }}" >{{ ship.name }} +
+ Arrived at: {{ ship.arrivedAt|date }} +