| Total Complexity | 2 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 80% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | abstract class OutputStream |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var mixed 出力ストリーム |
||
| 15 | */ |
||
| 16 | protected $stream; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * constructor |
||
| 20 | * @param mixed $stream 出力ストリーム |
||
| 21 | */ |
||
| 22 | 15 | public function __construct($stream) |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * destructor |
||
| 29 | */ |
||
| 30 | 15 | public function __destruct() |
|
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * 出力ストリームに書き出す |
||
| 37 | * @param mixed $buf 出力データ |
||
| 38 | * @param int|null $off データ開始位置 |
||
| 39 | * @param int|null $len 書き出すバイト数 |
||
| 40 | * @throws WebStream\Exception\Extend\IOException |
||
| 41 | */ |
||
| 42 | abstract public function write($buf, int $off = null, int $len = null); |
||
| 43 | |||
| 44 | /** |
||
| 45 | * バッファリングしているすべての出力バイトを書き出し、出力ストリームを閉じる |
||
| 46 | * @throws WebStream\Exception\Extend\IOException |
||
| 47 | */ |
||
| 48 | abstract public function close(); |
||
| 49 | |||
| 50 | /** |
||
| 51 | * バッファリングしているすべての出力バイトを出力ストリームを閉じずに強制的に書き出す |
||
| 52 | * writeを実行した時点では書き出されておらず、flushした時点ですべて書き出す |
||
| 53 | * @throws WebStream\Exception\Extend\IOException |
||
| 54 | */ |
||
| 55 | abstract public function flush(); |
||
| 56 | } |
||
| 57 |