setFormatter()
setFormatter(\Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter)
Parameters
\Symfony\Component\Console\Formatter\OutputFormatterInterface | $formatter |
NullOutput suppresses all output.
$output = new NullOutput();
setFormatter(\Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter)
\Symfony\Component\Console\Formatter\OutputFormatterInterface | $formatter |
getFormatter() : \Symfony\Component\Console\Formatter\OutputFormatterInterface
Returns current output formatter instance.
writeln(string|\Symfony\Component\Console\Output\iterable $messages, integer $options = self::OUTPUT_NORMAL)
Writes a message to the output and adds a newline at the end.
string|\Symfony\Component\Console\Output\iterable | $messages | The message as an iterable of strings or a single string |
integer | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL |
write(string|\Symfony\Component\Console\Output\iterable $messages, boolean $newline = false, integer $options = self::OUTPUT_NORMAL)
Writes a message to the output.
string|\Symfony\Component\Console\Output\iterable | $messages | The message as an iterable of strings or a single string |
boolean | $newline | Whether to add a newline |
integer | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Output;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
/**
* NullOutput suppresses all output.
*
* $output = new NullOutput();
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Tobias Schultze <http://tobion.de>
*/
class NullOutput implements OutputInterface
{
/**
* {@inheritdoc}
*/
public function setFormatter(OutputFormatterInterface $formatter)
{
// do nothing
}
/**
* {@inheritdoc}
*/
public function getFormatter()
{
// to comply with the interface we must return a OutputFormatterInterface
return new OutputFormatter();
}
/**
* {@inheritdoc}
*/
public function setDecorated($decorated)
{
// do nothing
}
/**
* {@inheritdoc}
*/
public function isDecorated()
{
return false;
}
/**
* {@inheritdoc}
*/
public function setVerbosity($level)
{
// do nothing
}
/**
* {@inheritdoc}
*/
public function getVerbosity()
{
return self::VERBOSITY_QUIET;
}
/**
* {@inheritdoc}
*/
public function isQuiet()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isVerbose()
{
return false;
}
/**
* {@inheritdoc}
*/
public function isVeryVerbose()
{
return false;
}
/**
* {@inheritdoc}
*/
public function isDebug()
{
return false;
}
/**
* {@inheritdoc}
*/
public function writeln($messages, $options = self::OUTPUT_NORMAL)
{
// do nothing
}
/**
* {@inheritdoc}
*/
public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL)
{
// do nothing
}
}