Skip to content

Call of $this->zipClass->close() repeat twice #2548

@idem84

Description

@idem84

Describe the Bug

Inside file TemplateProcessor.php in functions __destruct() and save() repeat code that close ZipArchive, and becouse of that error appears: ZipArchive::close() Invalid or unitialized Zip object

Steps to Reproduce

Please provide a code sample that reproduces the issue.

function __destruct() 
// ZipClass
        if ($this->zipClass) {
            try {
                $this->zipClass->close();
            } catch (Throwable $e) {
                // Nothing to do here.
            }
        }

function save()
// Close zip file
        if (false === $this->zipClass->close()) {
            throw new Exception('Could not close zip file.'); // @codeCoverageIgnore
        }

Expected Behavior

I think inside _destruct need to remove close() function

Context

Please fill in your environment information:

  • PHP Version: 7.4
  • PHPWord Version: Latest

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions