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 PHPStan findings at UserBasedTimezoneDetectorTest::testUserTimezoneDetection() #604

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

phansys
Copy link
Member

@phansys phansys commented Dec 17, 2023

Subject

PHPStan detects that other values than null are not returned and suggests to update the return type accordingly, but the null return type is supported since PHP 8.2 and we are currently supporting PHP 8.0:

... never returns null so it can be removed from the return type.

I am targeting this branch, because this change respects BC.

See: https://github.com/sonata-project/SonataIntlBundle/actions/runs/7240749104/job/19724081508?pr=602#step:5:11.

@phansys phansys requested a review from a team December 17, 2023 22:12
@phansys phansys marked this pull request as ready for review December 17, 2023 22:13
@VincentLanglet
Copy link
Member

but the null return type is supported since PHP 8.2 and we are currently supporting PHP 8.0:

This can be solved with phpdoc

/**
 * @return null
 */

@phansys
Copy link
Member Author

phansys commented Dec 18, 2023

This can be solved with phpdoc

I was afraid about the covariance, but you're right. The legacy interface has no type declarations.

It's updated. Thank you for the hint!

@VincentLanglet VincentLanglet merged commit a8a8d16 into sonata-project:3.x Dec 18, 2023
19 checks passed
@phansys phansys deleted the phpstan branch December 18, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants