Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add tests to support issue 4476 #4519

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

Open
blizzz wants to merge 1 commit into PHPOffice:master
base: master
Choose a base branch
Loading
from blizzz:tests-4476
Open

Conversation

Copy link

@blizzz blizzz commented Jun 20, 2025

This is:

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

Checklist:

  • Changes are covered by unit tests
    • Changes are covered by existing unit tests
    • New unit tests have been added
  • Code style is respected
  • Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
  • Documentation is updated as necessary

Why this change is needed?

This test shall proof that a time is interpreted wrongly, at least with XLSX. Cf. #4479 (comment)

Screenshot_20250620_120113

Koc reacted with thumbs up emoji
$reader = new Ods();
$spreadsheet = $reader->load($filename);
$sheet = $spreadsheet->getActiveSheet();
$rawValue = $sheet->getCell('A1')->getValue();
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can add:

/** @var float|int */

before this statement to eliminate the Phpstan error.

Copy link
Collaborator

The test failure here is, as we already know, a consequence of floating point rounding. However, it can be coded to avoid a problem. You want the result to agree to minutes (and the same general discussion would apply if you wanted to agree to seconds). You can achieve that by doing the following before formatting the DateTime object:

Date::roundMicroseconds($dt);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@oleibman oleibman oleibman left review comments

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /