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

fix: remove \ from DateTimeZone in functionMap #2693

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

simPod
Copy link
Contributor

@simPod simPod commented Oct 23, 2023

This causes issue in thecodingmachine/safe as their generator takes phpstan's fcnmap and generates function signatures. However, now it generates e.g. function date_create_immutable(string $datetime = "now", ?\\DateTimeZone $timezone = null): \DateTimeImmutable. Therefore, this fix is needed. (https://github.com/thecodingmachine/safe/actions/runs/6613051619/job/17960125168?pr=432#step:18:1115)

@phpstan-bot
Copy link
Collaborator

You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.

This causes issue in thecodingmachine/safe as their generator takes phpstan's fcnmap and generates function signatures. However, now it generates e.g. `function date_create_immutable(string $datetime = "now", ?\\DateTimeZone $timezone = null): \DateTimeImmutable`. Therefore, this fix is needed.
@ondrejmirtes
Copy link
Member

Therefore, this fix is needed.

Hi, I will merge this just to make everyone's life easier, but I disagree with the premise that the fix is really needed on PHPStan's side. PHPStan doesn't need this change and uses reflection data correctly.

Also other projects might benefit from combining multiple data sources as PHPStan does because functionMap does not always offer the full picture.

For example: PHPStan does not need to have delta files for PHP 8.3 because it already reads stuff that changed in PHP 8.3 from https://github.com/phpstan/php-8-stubs. So if thecodingmachine/safe reads these files and assumes that everything is correct for PHP 8.3, it's going to be wrong.

@ondrejmirtes ondrejmirtes merged commit 110ab29 into phpstan:1.10.x Oct 29, 2023
399 of 419 checks passed
@simPod simPod deleted the fix branch October 29, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants