Skip to content

Commit

Permalink
Improved OutputPrinter (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoreram authored Apr 8, 2021
1 parent 708ba7b commit 171fac9
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions OutputPrinter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the DriftPHP Project
* This file is part of the Drift Server
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,7 +13,7 @@

declare(strict_types=1);

namespace Drift\Console;
namespace Drift\Server;

use Symfony\Component\Console\Output\OutputInterface;

Expand All @@ -24,27 +24,37 @@ class OutputPrinter
{
private OutputInterface $output;
private bool $quiet;
private bool $almostQuiet;

/**
* ServerHeaderPrinter constructor.
*
* @param OutputInterface $output
* @param bool $beQuiet
* @param bool $quiet
* @param bool $almostQuiet
*/
public function __construct(
OutputInterface $output,
bool $beQuiet = false
bool $quiet,
bool $almostQuiet
) {
$this->output = $output;
$this->quiet = $beQuiet;
$this->quiet = $quiet;
$this->almostQuiet = $almostQuiet;
}

/**
* @return bool
*/
public function shouldPrintRegularOutput(): bool
{
return !$this->quiet && !$this->almostQuiet;
}

/**
* @return bool
*/
public function isQuiet(): bool
public function shouldPrintImportantOutput(): bool
{
return $this->quiet;
return !$this->quiet;
}

/**
Expand Down

0 comments on commit 171fac9

Please sign in to comment.