Skip to content

Commit 9b5d923

Browse files
author
Dan Cryer
committed
Fixing JSON mode
1 parent 6c0be0c commit 9b5d923

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

PhpDocblockChecker/CheckerCommand.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
129129
$processed = 0;
130130
$fileCountLength = strlen((string)$totalFiles);
131131

132+
if ($this->verbose) {
133+
$output->writeln('');
134+
$output->writeln('PHP Docblock Checker <fg=blue>by Dan Cryer (https://www.dancryer.com)</>');
135+
$output->writeln('');
136+
}
137+
132138
while (count($files)) {
133139
$chunk = array_shift($files);
134140
$chunkFiles = count($chunk);
@@ -139,17 +145,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
139145

140146
list($errors, $warnings) = $this->processFile($file);
141147

142-
if ($errors) {
143-
$this->output->write('<fg=red>F</>');
144-
} elseif ($warnings) {
145-
$this->output->write('<fg=yellow>W</>');
146-
} else {
147-
$this->output->write('<info>.</info>');
148+
if ($this->verbose) {
149+
if ($errors) {
150+
$this->output->write('<fg=red>F</>');
151+
} elseif ($warnings) {
152+
$this->output->write('<fg=yellow>W</>');
153+
} else {
154+
$this->output->write('<info>.</info>');
155+
}
148156
}
149157
}
150158

151-
$this->output->write(str_pad('', $filesPerLine - $chunkFiles));
152-
$this->output->writeln(' ' . str_pad($processed, $fileCountLength, ' ', STR_PAD_LEFT) . '/' . $totalFiles . ' (' . floor((100/$totalFiles) * $processed) . '%)');
159+
if ($this->verbose) {
160+
$this->output->write(str_pad('', $filesPerLine - $chunkFiles));
161+
$this->output->writeln(' ' . str_pad($processed, $fileCountLength, ' ', STR_PAD_LEFT) . '/' . $totalFiles . ' (' . floor((100/$totalFiles) * $processed) . '%)');
162+
}
153163
}
154164

155165
if ($this->verbose) {

0 commit comments

Comments
 (0)