setName(self::NAME) ->setDescription('Returns the list of orphan visits.') ->addOption('type', 't', InputOption::VALUE_REQUIRED, sprintf( 'Return visits only with this type. One of %s', enumToString(OrphanVisitType::class), )); } /** * @return Paginator */ protected function getVisitsPaginator(InputInterface $input, DateRange $dateRange): Paginator { $rawType = $input->getOption('type'); $type = $rawType !== null ? OrphanVisitType::from($rawType) : null; return $this->visitsHelper->orphanVisits(new OrphanVisitsParams(dateRange: $dateRange, type: $type)); } /** * @return array */ protected function mapExtraFields(Visit $visit): array { return ['type' => $visit->type->value]; } }