/** * Closing file stream * * @param \Magento\Framework\Filesystem\File\WriteInterface $stream * @return void */ protected function closeStream($stream) { if ($stream) { $stream->close(); } }