/** * Flush the internal buffer to the delegated writer */ private function flush() { foreach ($this->queue as $item) { $this->delegate->writeItem($item); } if ($this->delegate instanceof FlushableWriter) { $this->delegate->flush(); } }