An error occurred while loading the file. Please try again.
-
Youcef Aouad authored49aab685
<?php
/*
* © 2016 IRSTEA
* Guillaume Perréal <guillaume.perreal@irstea.fr>
* Tous droits réservés.
*/
namespace Irstea\PlantUmlBundle\Writer;
/**
* Description of OutputWriter
*
* @author Guillaume Perréal <guillaume.perreal@irstea.fr>
*/
class StreamWriter extends AbstractWriter
{
/**
* @var resource
*/
private $stream;
public function __construct($stream)
{
if (!is_resource($stream)) {
throw new \InvalidArgumentException("Expecting a stream, not a ". gettype($stream));
}
$this->stream = $stream;
}
protected function doWrite($data)
{
fwrite($this->stream, $data);
}
}