/** * @return Buffer */ protected function buildBuffer() { $buffer = new Buffer(); $dummy = null; $buffer->stream_open('buffer://path/to/some/file', 'w', null, $dummy); return $buffer; }