*/ class GetMediaInfoInput implements InputInterface { public function __construct( #[SourceRoute('imdbId')] public string $imdbId, #[SourceRoute('mediaType')] public string $mediaType, #[SourceRoute('season', nullify: true)] public ?int $season, #[SourceRoute('episode', nullify: true)] public ?int $episode, ) {} public function toCommand(): CommandInterface { if ("tvshows" === $this->mediaType && null === $this->season) { $this->season = 1; } if ("tvshows" === $this->mediaType && null === $this->episode) { $this->episode = 1; } return new GetMediaInfoCommand($this->imdbId, $this->mediaType, $this->season, $this->episode); } }