Skip to content

Commit f09a713

Browse files
authored
Merge pull request #1 from noximo/noximo-work-changes
Work changes
2 parents 3fe87c0 + 9a32314 commit f09a713

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

src/FileOutput.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ public function __construct(string $outputFile, ?ErrorFormatter $defaultFormatte
5353
} catch (RegexpException $e) {
5454
}
5555

56-
$outputFile = realpath($outputFile);
57-
if ($outputFile !== false) {
58-
$this->outputFile = $outputFile;
59-
}
56+
$this->outputFile = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $outputFile);
6057

6158
$customTemplateFile = $customTemplate !== null ? realpath($customTemplate) : false;
6259
if ($customTemplateFile !== false) {
@@ -72,18 +69,15 @@ public function __construct(string $outputFile, ?ErrorFormatter $defaultFormatte
7269
*/
7370
public function formatErrors(AnalysisResult $analysisResult, OutputStyle $style): int
7471
{
72+
if ($this->defaultFormatter !== null) {
73+
$this->defaultFormatter->formatErrors($analysisResult, $style);
74+
}
7575
try {
76-
if ($this->outputFile === null) {
77-
throw new IOException('Real path of file could not be resolved');
78-
}
7976
$this->generateFile($analysisResult);
80-
$style->writeln('Note: Analysis outputted into file ' . $this->outputFile . '.');
77+
$style->writeln('Note: Analysis outputted into file ' . realpath($this->outputFile) . '.');
8178
} catch (IOException $e) {
8279
$style->error('Analysis could not be outputted into file. ' . $e->getMessage());
8380
}
84-
if ($this->defaultFormatter !== null) {
85-
$this->defaultFormatter->formatErrors($analysisResult, $style);
86-
}
8781

8882
return $analysisResult->hasErrors() ? 1 : 0;
8983
}

src/table.phtml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ namespace noximo;
99
body {
1010
background-color: #34495e;
1111
color: white;
12-
font-family: sans-serif;
12+
font-family: monospace;
13+
font-size: 16px;
14+
}
15+
16+
b {
17+
color: lightskyblue;
1318
}
1419

1520
h1 {
@@ -29,23 +34,31 @@ namespace noximo;
2934
color: yellow;
3035
}
3136

37+
table {
38+
width: 100%;
39+
font-size: 12px;
40+
}
41+
3242
th {
3343
text-align: left;
3444
padding: 25px 0 10px 0;
3545
}
3646

47+
td {
48+
padding: 5px;
49+
}
50+
3751
.section {
3852
font-size: 1.4em;
3953
}
4054

4155
.line {
4256
text-align: right;
43-
vertical-align: top;
44-
padding: 1px 10px 0 0px;
57+
vertical-align: middle;
4558
}
4659

47-
tr:nth-child(even) {
48-
background: #475a73
60+
.error:nth-child(odd) {
61+
background: #374d63
4962
}
5063

5164
#thanks {
@@ -71,7 +84,7 @@ namespace noximo;
7184
</tr>
7285
</thead>
7386
<?php foreach ($data[FileOutput::UNKNOWN] as $error): ?>
74-
<tr>
87+
<tr class="error">
7588
<td>
7689
<?= $error ?>
7790
</td>
@@ -91,7 +104,7 @@ namespace noximo;
91104
</tr>
92105
</thead>
93106
<?php foreach ($errors as $error): ?>
94-
<tr>
107+
<tr class="error">
95108
<td class="line">
96109
<a href='<?= $error[FileOutput::LINK] ?>'><?= $error[FileOutput::LINE] ?></a>
97110
</td>

0 commit comments

Comments
 (0)