Skip to content

Commit 9841785

Browse files
committed
Fixed inspections position
1 parent 83619f7 commit 9841785

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

phar-result.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,15 @@
121121
if($_POST["inspection_lint"] === "on"){
122122
$inspections[] = new SyntaxErrorInspection($dir);
123123
}
124-
$jsonData = [
125-
"phar" => "http://pmt.mcpe.me" . $url,
126-
"expiry" => time() + 7200,
127-
"inspections" => []
128-
];
129-
foreach($inspections as $inspection){
130-
$result = $inspection->run();
131-
if(!$jsonExpected){
132-
$result->htmlEcho();
133-
}else{
134-
$jsonData["inspections"][$result->getName()] = $result->jsonResult();
135-
}
136-
}
137124
if($jsonExpected){
125+
$jsonData = [
126+
"phar" => "http://pmt.mcpe.me" . $url,
127+
"expiry" => time() + 7200,
128+
"inspections" => []
129+
];
130+
foreach($inspections as $inspection){
131+
$jsonData["inspections"][$result->getName()] = $inspection->run()->jsonResult();
132+
}
138133
echo json_encode($jsonData);
139134
die;
140135
}
@@ -148,6 +143,9 @@
148143
echo "<hr>";
149144
echo "<h2>Inspections</h2>";
150145
echo "<ul>";
146+
foreach($inspections as $inspection){
147+
$inspection->run()->htmlEcho();
148+
}
151149
echo "</ul>";
152150
echo "<p>End of inspections</p>";
153151
?>

0 commit comments

Comments
 (0)