
| Current Path : /var/www/html/ift/vendor/consolidation/robo/src/Common/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/ift/vendor/consolidation/robo/src/Common/OutputAdapter.php |
<?php
namespace Robo\Common;
use Robo\Contract\OutputAdapterInterface;
use Robo\Contract\OutputAwareInterface;
use Robo\Contract\VerbosityThresholdInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Adapt OutputInterface or other output function to the VerbosityThresholdInterface.
*/
class OutputAdapter implements OutputAdapterInterface, OutputAwareInterface
{
use OutputAwareTrait;
/**
* @var int[]
*/
protected $verbosityMap = [
VerbosityThresholdInterface::VERBOSITY_NORMAL => OutputInterface::VERBOSITY_NORMAL,
VerbosityThresholdInterface::VERBOSITY_VERBOSE => OutputInterface::VERBOSITY_VERBOSE,
VerbosityThresholdInterface::VERBOSITY_VERY_VERBOSE => OutputInterface::VERBOSITY_VERY_VERBOSE,
VerbosityThresholdInterface::VERBOSITY_DEBUG => OutputInterface::VERBOSITY_DEBUG,
];
/**
* {@inheritdoc}
*/
public function verbosityMeetsThreshold($verbosityThreshold)
{
if (!isset($this->verbosityMap[$verbosityThreshold])) {
return true;
}
$verbosityThreshold = $this->verbosityMap[$verbosityThreshold];
$verbosity = $this->output()->getVerbosity();
return $verbosity >= $verbosityThreshold;
}
/**
* {@inheritdoc}
*/
public function writeMessage($message)
{
$this->output()->write($message);
}
}