Skip to content

Conversation

oleibman
Copy link
Collaborator

In issue #4557, the user complains, with some justification, about the way Excel handles certain calculations. We are not able to help with that problem. However, the user also notes a problem in Shared/Date when isDateTime has to evaluate a cell whose calculated value is an array. This is solved by flattening the calculated result to a single value.

It became obvious while working on this change that the code to set instanceArrayReturnType was kind of awkward. Simpler methods returnArrayAsArray and returnArrayAsValue are added to Spreadsheet. Even these started out a bit awkward because Spreadsheet::calculationEngine was defined as nullable, which really isn't true. It is allocated by the constructor, and never freed except in the destructor. It is no longer nullable.

This is:

  • a bugfix
  • a new feature
  • refactoring
  • additional unit tests

Checklist:

In issue PHPOffice#4557, the user complains, with some justification, about the way Excel handles certain calculations. We are not able to help with that problem. However, the user also notes a problem in Shared/Date when `isDateTime` has to evaluate a cell whose calculated value is an array. This is solved by flattening the calculated result to a single value.

It became obvious while working on this change that the code to set `instanceArrayReturnType` was kind of awkward. Simpler methods `returnArrayAsArray` and `returnArrayAsValue` are added to `Spreadsheet`. Even these started out a bit awkward because `Spreadsheet::calculationEngine` was defined as nullable, which really isn't true. It is allocated by the constructor, and never freed except in the destructor. It is no longer nullable.
@oleibman oleibman added this pull request to the merge queue Aug 6, 2025
Merged via the queue into PHPOffice:master with commit ea97afb Aug 6, 2025
14 checks passed
@oleibman oleibman deleted the issue4557date branch August 6, 2025 08:42
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.

1 participant