1
0
Fork 0

Allow passing a custom output formatter to the BufferIO

pull/1288/head
Jordi Boggiano 2012-11-05 13:52:15 +01:00
parent aecf4ffe91
commit a7b14952b8
1 changed files with 3 additions and 3 deletions

View File

@ -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()));
} }