for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpSchool\Terminal\IO;
/**
* @author Aydin Hassan <[email protected]>
*/
class BufferedOutput implements OutputStream
{
private $buffer = '';
public function write(string $buffer): void
$this->buffer .= $buffer;
}
public function fetch(bool $clean = true) : string
$buffer = $this->buffer;
if ($clean) {
$this->buffer = '';
return $buffer;
public function __toString() : string
return $this->fetch();
* Whether the stream is connected to an interactive terminal
public function isInteractive() : bool
return false;