-
Notifications
You must be signed in to change notification settings - Fork 677
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
IntlDateFormatter::__construct (and probably other methods) CallMap is incorrect #8735
Comments
I found these snippets: https://psalm.dev/r/b6ebba0bf1<?php
new IntlDateFormatter('en_US', timeType: IntlDateFormatter::SHORT);
|
Hey! We have a full article on callmap editing! https://psalm.dev/docs/contributing/editing_callmaps/ The short version is: you start with Callmap.php which represent the more up to date signatures (for 8.2 currently). Then, for each version you want to "erase", you process the delta files. That means if you want to analyse using 8.1, you first take the Callmap.php file and then you remove all function marked as "added" in Callmap_82_delta.php, you re-add all function marked as "removed" and replace every "changed" function by taking the "new" signature and swapping it with the "old" And that gives you the state of the signature in 8.1. If you do that for each version, you roll back to 7.1 (the full file is described in Callmap_historical.php) The CI includes all the tests needed to make sure everything is consistent so you can go with your eyes closed, if there's an error, we'll know :) |
Thank you very much for the docs and the explainations. I'll try to provide something for today 😉 |
Here it is. It took longer than expected as I wasn't able to find official PHP Documentation of the previous versions. Cheers to "the wayback machine" archive for giving me access to old PHP website's documentation. I only took care of the Thanks a lot! EDIT: This check does not pass, but it doesn't look like related to my changes. Is it a problem or a false-positive? |
Fix #8735: IntlDateFormatter CallMaps.
The signatures were pretty broken before! Thanks for your efforts! Don't worry about procedural functions, if it bothers someone, it will end up fixed in the end! |
Regarding https://psalm.dev/r/b6ebba0bf1 and the PHP Documentation, it looks like the CallMap is KO about this.
Looking at the current CallMap I found, it looks like also IntlDateFormatter::create(…) is not OK, so maybe a global review of the CallMap for this class could be done.
I wish I could update it but looking as PhpStorm's stubs, this method changed a lot from PHP 5.3 to PHP 8.1 and I'm not sure how can I update the CallMap files accordingly, neither how can I test it.
If someone can provide just a single example of how to update the CallMap (+ maybe specific CallMaps for PHP 8.0, PHP 8.1…) correctly of one single method, then I could spend some time to replicate this to the whole class myself.
Thanks a lot.
The text was updated successfully, but these errors were encountered: