diff --git a/src/FileOutput.php b/src/FileOutput.php index 357e133..736fd03 100644 --- a/src/FileOutput.php +++ b/src/FileOutput.php @@ -53,10 +53,7 @@ public function __construct(string $outputFile, ?ErrorFormatter $defaultFormatte } catch (RegexpException $e) { } - $outputFile = realpath($outputFile); - if ($outputFile !== false) { - $this->outputFile = $outputFile; - } + $this->outputFile = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $outputFile); $customTemplateFile = $customTemplate !== null ? realpath($customTemplate) : false; if ($customTemplateFile !== false) { @@ -72,18 +69,15 @@ public function __construct(string $outputFile, ?ErrorFormatter $defaultFormatte */ public function formatErrors(AnalysisResult $analysisResult, OutputStyle $style): int { + if ($this->defaultFormatter !== null) { + $this->defaultFormatter->formatErrors($analysisResult, $style); + } try { - if ($this->outputFile === null) { - throw new IOException('Real path of file could not be resolved'); - } $this->generateFile($analysisResult); - $style->writeln('Note: Analysis outputted into file ' . $this->outputFile . '.'); + $style->writeln('Note: Analysis outputted into file ' . realpath($this->outputFile) . '.'); } catch (IOException $e) { $style->error('Analysis could not be outputted into file. ' . $e->getMessage()); } - if ($this->defaultFormatter !== null) { - $this->defaultFormatter->formatErrors($analysisResult, $style); - } return $analysisResult->hasErrors() ? 1 : 0; } diff --git a/src/table.phtml b/src/table.phtml index 8745759..a1aefc1 100644 --- a/src/table.phtml +++ b/src/table.phtml @@ -9,7 +9,12 @@ namespace noximo; body { background-color: #34495e; color: white; - font-family: sans-serif; + font-family: monospace; + font-size: 16px; + } + + b { + color: lightskyblue; } h1 { @@ -29,23 +34,31 @@ namespace noximo; color: yellow; } + table { + width: 100%; + font-size: 12px; + } + th { text-align: left; padding: 25px 0 10px 0; } + td { + padding: 5px; + } + .section { font-size: 1.4em; } .line { text-align: right; - vertical-align: top; - padding: 1px 10px 0 0px; + vertical-align: middle; } - tr:nth-child(even) { - background: #475a73 + .error:nth-child(odd) { + background: #374d63 } #thanks { @@ -71,7 +84,7 @@ namespace noximo; -