Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/FileOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down
27 changes: 20 additions & 7 deletions src/table.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -71,7 +84,7 @@ namespace noximo;
</tr>
</thead>
<?php foreach ($data[FileOutput::UNKNOWN] as $error): ?>
<tr>
<tr class="error">
<td>
<?= $error ?>
</td>
Expand All @@ -91,7 +104,7 @@ namespace noximo;
</tr>
</thead>
<?php foreach ($errors as $error): ?>
<tr>
<tr class="error">
<td class="line">
<a href='<?= $error[FileOutput::LINK] ?>'><?= $error[FileOutput::LINE] ?></a>
</td>
Expand Down