Skip to content

Commit

Permalink
Merge pull request #137 from exussum12/printer
Browse files Browse the repository at this point in the history
Adust console options and remove magic number
  • Loading branch information
exussum12 committed Oct 6, 2021
2 parents cf49345 + d9b532a commit 7fc703d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Printer/Console.php
Expand Up @@ -15,12 +15,12 @@
*/
class Console implements Printer
{
const LINE_LENGTH = 80;
const TAB = 4;
const DEFAULT_LINE_LENGTH = 80;

public function printData(OutputInterface $output, FileReportList $fileReportList, HintList $hintList): void
{
$separator = str_repeat('-', self::LINE_LENGTH);
$length = (int) (`tput cols` ?: self::DEFAULT_LINE_LENGTH);
$separator = str_repeat('-', $length);
$output->writeln(PHP_EOL . $separator . PHP_EOL);

$total = 0;
Expand All @@ -45,7 +45,7 @@ public function printData(OutputInterface $output, FileReportList $fileReportLis
if (false === empty($hints)) {
$output->writeln('Suggestions:');
foreach ($hints as $hint) {
$output->writeln(str_repeat(' ', 2 * self::TAB) . $hint);
$output->writeln("\t\t" . $hint);
}
$output->write(PHP_EOL);
}
Expand Down

0 comments on commit 7fc703d

Please sign in to comment.