Closed Metalaka closed 9 years ago
I am actually doing the same thing with an Input
class in https://github.com/hoaproject/Console/pull/51.
Looks correct.
Hmm, there is an issue with tests. We use ->output
to test the output. Unfortunately, it does not consider php://stdout
, which is different for PHP. So, sorry but… I guess this is dangerous to work on php://stdout
with Hoa\File\Write
and using echo
seems to be a good solution here. Consequently, we need to test if (null === $this->_output)
everywhere to put some echo
s everywhere.
Sorry for this undo!
This is not an issue with testing only actually. I meant: php://stdout
seems different than echo
in this low-level. I don't know exactly why though.
Corrected.
Seems correct!
See https://github.com/hoaproject/Console/pull/55#discussion_r42047716
Hoa\Console::getOutput
returnHoa\Stream\IStream\Out
and then type check must be done to allow correct uses ofHoa\Console\Output
's multiplexer feature. Requiring type check in methods usage looks like a wrong approach.Hoa\Console\Output
can embed an instance ofHoa\Stream\IStream\Out
. Like thatOutput::isMultiplexerConsidered
&Output::considerMultiplexer
are always available. And whenOutput::write
is called, an internal call toHoa\Stream\IStream\Out
is done.