Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Php7 Problem with TemplateProcessor Destructor #2554

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

oleibman
Copy link
Contributor

@oleibman oleibman commented Jan 18, 2024

Description

A particularly perplexing problem accidentally introduced by PR #2475. Problem does not arise for Php8, and does not arise for Php7 unit tests. But, running not under Phpunit auspices with Php7 can cause a warning message at destructor time if the save function has been used. A very artificial test is introduced to test this situation.

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes #2548

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

Fix PHPOffice#2548. A particularly perplexing problem accidentally introduced by PR PHPOffice#2475. Problem does not arise for Php8, and does not arise for Php7 unit tests. But, running *not* under Phpunit auspices with Php7 can cause a warning message at destructor time if the `save` function has been used. A very artificial test is introduced to test this situation.
@coveralls
Copy link

Coverage Status

coverage: 97.218% (+0.001%) from 97.217%
when pulling e295f86 on oleibman:word2548
into 2f4da6e on PHPOffice:master.

Copy link
Member

@Progi1984 Progi1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small feedback

@bunglegrind
Copy link

In https://www.php.net/manual/en/ziparchive.close.php is stated:

This method is automatically called at the end of the script.

Maybe we don't need an explict call inside __destroy

@Progi1984 Progi1984 added this to the 2.0.0 milestone Aug 7, 2024
@Progi1984 Progi1984 merged commit 8e441e8 into PHPOffice:master Aug 7, 2024
13 checks passed
@Progi1984 Progi1984 deleted the word2548 branch August 7, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Call of $this->zipClass->close() repeat twice
5 participants