From fc2630f27af103c8580fec3cbf4ca1481189ff2c Mon Sep 17 00:00:00 2001 From: Marco Cesarato Date: Sun, 27 Dec 2020 03:10:54 +0100 Subject: [PATCH] fix: append extension report --- src/Scanner.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Scanner.php b/src/Scanner.php index 0ac56c0..5b47db2 100644 --- a/src/Scanner.php +++ b/src/Scanner.php @@ -443,11 +443,6 @@ private function arguments($args = null) } } - // Report format - if (isset(self::$argv['report-format']) && !empty(self::$argv['report-format'])) { - self::setReportFormat(self::$argv['report-format']); - } - // Offset self::setOffset(0); if (isset(self::$argv['offset']) && is_numeric(self::$argv['offset'])) { @@ -479,6 +474,19 @@ private function arguments($args = null) self::setPathReport(self::$argv['path-report']); } + // Report format + if (isset(self::$argv['report-format']) && !empty(self::$argv['report-format'])) { + self::setReportFormat(self::$argv['report-format']); + } + + if (in_array(self::$reportFormat, ['html', 'htm'])) { + if (!preg_match('/[\S][.](html|htm)$/', self::$pathReport)) { + self::$pathReport .= '.html'; + } + } elseif (!preg_match('/[\S][.](logs|log|txt)$/', self::$pathReport)) { + self::$pathReport .= '.log'; + } + // Path logs if (isset(self::$argv['path-logs']) && !empty(self::$argv['path-logs'])) { self::setPathLogs(self::$argv['path-logs']); @@ -1890,14 +1898,6 @@ public static function setReportFormat($reportFormat) self::$reportFormat = $reportFormat; } - if (in_array(self::$reportFormat, ['html', 'htm'])) { - if (!preg_match('/[\S][.](html|htm)$/', self::$pathReport)) { - self::$pathReport .= '.html'; - } - } elseif (!preg_match('/[\S][.](logs|log|txt)$/', self::$pathReport)) { - self::$pathReport .= '.log'; - } - return new static(); }