Skip to content

Commit d9ad656

Browse files
committed
invert and early out
1 parent 6c6c2e3 commit d9ad656

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

web/reload-fixtures.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ function runCommand($command, $shouldHaveOutput = true)
77
echo "Running: $command\n";
88
exec($command, $output, $return_var);
99

10-
if ($shouldHaveOutput) {
11-
if (empty($output) || !is_array($output)) {
12-
echo 'Fixtures could not be loaded: '.var_export($return_var, true);
13-
exit(1);
14-
}
15-
echo PHP_EOL;
16-
echo "Output:\n";
17-
foreach ($output as $line) {
18-
echo $line."\n";
19-
}
10+
if (!$shouldHaveOutput) {
11+
return;
12+
}
13+
14+
if (empty($output) || !is_array($output)) {
15+
echo 'Fixtures could not be loaded: '.var_export($return_var, true);
16+
exit(1);
17+
}
18+
echo PHP_EOL;
19+
echo "Output:\n";
20+
foreach ($output as $line) {
21+
echo $line."\n";
2022
}
2123
}
2224

0 commit comments

Comments
 (0)