Movatterモバイル変換


[0]ホーム

URL:


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

[Intl] Remove incorrect condition inCurrencyDataGenerator::icuPairToDate#61681

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:6.4fromGromNaN:icuPairToDate
Sep 8, 2025

Conversation

@GromNaN
Copy link
Member

@GromNaNGromNaN commentedSep 7, 2025
edited
Loading

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#61556 (comment)
LicenseMIT

Remove a useless condition that breaks psalm analysis.

  • 1 << 63 === PHP_INT_MIN we cannot have a lower int value
  • 1 << 64 === 0 so the removing this value doesn't change anything

Fix psalm crash due to bugvimeo/psalm#11209
WhenPHP_INT_MIN - 1, the value is converted to a float that breaks the type system of psalmhttps://github.com/vimeo/psalm/blob/279f3eab037923d3f9d3ea3de1a16b425653e30c/src/Psalm/Internal/Type/SimpleAssertionReconciler.php#L2073

Dealing with timestamp>= (1 << 62)/1000 will be necessary when we reachyear 146140482.

Crovitche-1623 reacted with thumbs up emoji
@carsonbot

This comment was marked as outdated.

@GromNaNGromNaN changed the base branch from7.4 to6.4September 7, 2025 21:13
…Date1 << 63 === PHP_INT_MIN we cannot have a lower int value1 << 64 === 0 so the removing this value doesn't change anythingFix psalm crash due to bugvimeo/psalm#11209When doing PHP_INT_MIN - 1, the value is converted to a float that breaks the type system of psalmhttps://github.com/vimeo/psalm/blob/279f3eab037923d3f9d3ea3de1a16b425653e30c/src/Psalm/Internal/Type/SimpleAssertionReconciler.php#L2073
Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a psalm analysis issue by removing an unnecessary condition in theCurrencyDataGenerator::icuPairToDate method that was causing static analysis to crash. The removed condition was mathematically redundant since1 << 63 === PHP_INT_MIN represents the lowest possible integer value, and1 << 64 === 0, making the subtraction operation meaningless.

  • Removes redundant signed/unsigned 64-bit integer conversion logic
  • Fixes psalm static analysis crash related to integer overflow handling
  • Maintains existing functionality while improving code analysis compatibility

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

@Crovitche-1623
Copy link
Contributor

Crovitche-1623 commentedSep 8, 2025
edited
Loading

Thanks@GromNaN The fix seems correct to me.

PHP seems to store the sign in the last bit.

Therefore, when we do 1 << 63, PHP automatically transforms the value to a float instead of going in negative values for safety purpose. That was probably the reason why psalm was failing

As you said, this is not an issue if we have a float for the following calculations as long as we don't reach the value (1 << 62) /1000 + 1

@nicolas-grekas
Copy link
Member

Thank you@GromNaN.

@nicolas-grekasnicolas-grekas merged commit1f64ca9 intosymfony:6.4Sep 8, 2025
8 of 11 checks passed
@GromNaNGromNaN deleted the icuPairToDate branchSeptember 8, 2025 10:18
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

+1 more reviewer

@Crovitche-1623Crovitche-1623Crovitche-1623 approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

4 participants

@GromNaN@carsonbot@Crovitche-1623@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp