From ede6dc9c249363989d6490c4ccdcd156ceb42839 Mon Sep 17 00:00:00 2001 From: Lio Novelli Date: Sun, 15 May 2022 13:04:50 +0200 Subject: [PATCH] Fix small bugs. --- app/src/Commands/InvoiceCommand.php | 1 + app/src/Commands/ReportCommand.php | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/Commands/InvoiceCommand.php b/app/src/Commands/InvoiceCommand.php index bf16dcf..027087d 100644 --- a/app/src/Commands/InvoiceCommand.php +++ b/app/src/Commands/InvoiceCommand.php @@ -145,6 +145,7 @@ class InvoiceCommand extends Command if ($input->getOption('list-reports')) { $list = $this->youtrack->listReports(); $output->writeln(var_export($list, TRUE)); + return Command::SUCCESS; } if ($input->hasParameterOption('--report') || $input->hasParameterOption('-r')) { if ($report = $input->getOption('report')) { diff --git a/app/src/Commands/ReportCommand.php b/app/src/Commands/ReportCommand.php index 4619b24..7dc9fee 100644 --- a/app/src/Commands/ReportCommand.php +++ b/app/src/Commands/ReportCommand.php @@ -49,6 +49,16 @@ class ReportCommand extends Command { } protected function execute(InputInterface $input, OutputInterface $output) :int { + if ($timeRange = $input->getOption('time-range')) { + // @TODO: Implement time range option: + // - Request workTime items from tracking service + // - Filter them, join by issue, project ... + if ($output->isVerbose()) { + $output->writeln("Time range: {$timeRange}"); + } + $output->writeln('This option is not supported yet.'); + return Command::FAILURE; + } $reports = $this->trackingService->listReports(); // Could just parse a csv file or actually get workItems from youtrack ... if ($input->hasParameterOption('--report') || $input->hasParameterOption('-r')) { @@ -73,13 +83,6 @@ class ReportCommand extends Command { elseif ($report = $this->config->get('tracking_service.youtrack.report.default')) { $this->trackingService->setReportId($report); } - elseif ($timeRange = $input->getParameterOption('time-range')) { - // @TODO: Implement time range option: - // - Request workTime items from tracking service - // - Filter them, join by issue, project ... - $output->writeln('This option is not supported yet.'); - return Command::FAILURE; - } // Currently we only support csv download. $report_id = $this->trackingService->getReportId(); $report_name = $reports[$report_id];