Allow passing a custom output formatter to the BufferIO
parent
aecf4ffe91
commit
a7b14952b8
|
@ -13,6 +13,7 @@
|
||||||
namespace Composer\IO;
|
namespace Composer\IO;
|
||||||
|
|
||||||
use Symfony\Component\Console\Output\StreamOutput;
|
use Symfony\Component\Console\Output\StreamOutput;
|
||||||
|
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
||||||
use Symfony\Component\Console\Input\StringInput;
|
use Symfony\Component\Console\Input\StringInput;
|
||||||
use Symfony\Component\Console\Helper\HelperSet;
|
use Symfony\Component\Console\Helper\HelperSet;
|
||||||
|
|
||||||
|
@ -25,13 +26,12 @@ class BufferIO extends ConsoleIO
|
||||||
* @param string $input
|
* @param string $input
|
||||||
* @param int $verbosity
|
* @param int $verbosity
|
||||||
*/
|
*/
|
||||||
public function __construct($input = '', $verbosity = null)
|
public function __construct($input = '', $verbosity = null, OutputFormatterInterface $formatter = null)
|
||||||
{
|
{
|
||||||
$input = new StringInput($input);
|
$input = new StringInput($input);
|
||||||
$input->setInteractive(false);
|
$input->setInteractive(false);
|
||||||
|
|
||||||
// TODO pass a custom output formatter for html tags
|
$output = new StreamOutput(fopen('php://memory', 'rw'), $verbosity === null ? StreamOutput::VERBOSITY_NORMAL : $verbosity, !empty($formatter), $formatter);
|
||||||
$output = new StreamOutput(fopen('php://memory', 'rw'), $verbosity === null ? StreamOutput::VERBOSITY_NORMAL : $verbosity, false);
|
|
||||||
|
|
||||||
parent::__construct($input, $output, new HelperSet(array()));
|
parent::__construct($input, $output, new HelperSet(array()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue