-
Notifications
You must be signed in to change notification settings - Fork 790
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
Update date exception thrown #1646
base: master
Are you sure you want to change the base?
Conversation
I don't think failure are related @isfedorov |
@VincentLanglet Yes, the failure itself isn't related. Docker image just couldn't build. But still it's not possible to merge the changes. |
Is it better now ? I'm getting "Everything is up to date", and if I look at my branch https://github.com/VincentLanglet/phpstorm-stubs/tree/date-exception, there is only one extra commit over master |
@VincentLanglet Still the same problem. Don't know what can it be, but nevermind, I'll merge it manually, but before that, could you please clarify why you have changed exception to DateException but not DateInvalidTimeZoneException? According to RFC |
b7084b0
to
2f16a63
Compare
There are 4 new exceptions which extends DateException:
Since I wasn't sure about when they are thrown I wanted to update the stubs in a way I was sure it was correct. But I re-read the RFC, looked at the implementation and tried on PHP and I would say (cf php/php-src@66a1a91)
I updated the PR. I discovered there is also some other behavior changes and I didn't know how to update the stubs correctly in order to not give a wrong stub for PHP < 8.3 users.
I tried LanguageLevelTypeAware in 0df0010, is it the right way @isfedorov ? |
2f16a63
to
936c45f
Compare
Sorry for the delay @isfedorov ; I fixed the build |
@VincentLanglet Thank you! The approach with LanguageLevelTypeAware looks correct in this case but I'd remove return types from method signatures in this case, since return types are already declared by attributes. Could you please update signatures? |
As shown by the CI https://github.com/JetBrains/phpstorm-stubs/actions/runs/9487379401/job/26143867750?pr=1646 @isfedorov I need to keep the method signature to have a green CI. (The previous commit 3a01281 had green tests) |
@VincentLanglet Actually the failure says that return type of methods |
ff18d25
to
0d0ed85
Compare
I see, I'll try to understand if false is still a possible return type. |
The issue is on the PHP side. I assume we have to wait for the merge and a new PHP 8.3 release in order to have green tests ? |
@isfedorov I got an anwser. The return type was buggy in PHP 8.3, but it's fixed and the fix will be landed in PHP 8.4. I update the LanguageLevelTypeAware attribute then |
Cf https://wiki.php.net/rfc/datetime-exceptions