diff --git a/src/Enum/StarshipStatusEnum.php b/src/Enum/StarshipStatusEnum.php new file mode 100644 index 0000000..a499832 --- /dev/null +++ b/src/Enum/StarshipStatusEnum.php @@ -0,0 +1,11 @@ +name; } - public function getStatus(): string + public function getStatus(): StarshipStatusEnum { return $this->status; } diff --git a/src/Repository/StarshipRepository.php b/src/Repository/StarshipRepository.php index a049657..cc9da45 100644 --- a/src/Repository/StarshipRepository.php +++ b/src/Repository/StarshipRepository.php @@ -2,6 +2,7 @@ namespace App\Repository; +use App\Enum\StarshipStatusEnum; use App\Model\Starship; use Psr\Log\LoggerInterface; @@ -16,18 +17,18 @@ class StarshipRepository $this->logger->info('Starship Repository: Finding Starships'); return [ - new Starship(1, 'Starship 01', 'Heavy Starship', 'Human Captain', 'damaged'), - new Starship(2, 'Starship 02', 'Light Starship', 'Robot Captain', 'new'), - new Starship(3, 'USS Voyager', 'Intrepid-class', 'Kathryn Janeway', 'Active'), - new Starship(4, 'Starblade', 'Interceptor-class', 'Lance Stellar', 'In repair'), - new Starship(5, 'Black Star', 'Battlecruiser-class', 'Zara Nox', 'Active'), - new Starship(6, 'SS Horizon', 'Explorer-class', 'James Marshall', 'Decommissioned'), - new Starship(7, 'Nebula Queen', 'Transport-class', 'Elara Trent', 'Under inspection'), - new Starship(8, 'Celestial Wave', 'Frigate-class', 'Talon Skye', 'On mission'), - new Starship(9, 'Galactic Serpent', 'Destroyer-class', 'Viktor Helios', 'Active'), - new Starship(10, 'Phoenix Wing', 'Carrier-class', 'Aurora Drake', 'Awaiting orders'), - new Starship(11, 'Silver Comet', 'Scout-class', 'Finn O\'Neil', 'In dock'), - new Starship(12, 'Crimson Spear', 'Corvette-class', 'Raven Callen', 'Destroyed'), + 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-class', 'Kathryn Janeway', StarshipStatusEnum::WAITING), + new Starship(4, 'Starblade', 'Interceptor-class', 'Lance Stellar', StarshipStatusEnum::COMPLETED), + new Starship(5, 'Black Star', 'Battlecruiser-class', 'Zara Nox', StarshipStatusEnum::WAITING), + new Starship(6, 'SS Horizon', 'Explorer-class', 'James Marshall', StarshipStatusEnum::COMPLETED), + new Starship(7, 'Nebula Queen', 'Transport-class', 'Elara Trent', StarshipStatusEnum::IN_PROGRESS), + new Starship(8, 'Celestial Wave', 'Frigate-class', 'Talon Skye', StarshipStatusEnum::IN_PROGRESS), + new Starship(9, 'Galactic Serpent', 'Destroyer-class', 'Viktor Helios', StarshipStatusEnum::COMPLETED), + new Starship(10, 'Phoenix Wing', 'Carrier-class', 'Aurora Drake', StarshipStatusEnum::COMPLETED), + new Starship(11, 'Silver Comet', 'Scout-class', 'Finn O\'Neil', StarshipStatusEnum::WAITING), + new Starship(12, 'Crimson Spear', 'Corvette-class', 'Raven Callen', StarshipStatusEnum::IN_PROGRESS), ]; } diff --git a/templates/main/homepage.html.twig b/templates/main/homepage.html.twig index e5145ba..6cd8775 100644 --- a/templates/main/homepage.html.twig +++ b/templates/main/homepage.html.twig @@ -12,36 +12,37 @@
+
in progress
+{{ ship.status.value }}
Captain
-Jean-Luc Pickles
+{{ ship.captain }}
Class
-Garden
+{{ ship.class }}