12 namespace Symfony\Component\Console\Output;
49 if (!is_resource(
$stream) ||
'stream' !== get_resource_type(
$stream)) {
50 throw new \InvalidArgumentException(
'The StreamOutput class needs a stream as its first argument.');
55 if (null === $decorated) {
75 protected function doWrite($message, $newline)
77 if (
false === @fwrite($this->stream, $message.($newline ? PHP_EOL :
''))) {
79 throw new \RuntimeException(
'Unable to write output.');
82 fflush($this->stream);
97 if (DIRECTORY_SEPARATOR ===
'\\') {
98 return false !== getenv(
'ANSICON') ||
'ON' === getenv(
'ConEmuANSI');
101 return function_exists(
'posix_isatty') && @posix_isatty($this->stream);