Skip to content

Improve StrSplit returnType - #3999

Merged
ondrejmirtes merged 1 commit into
phpstan:2.1.xfrom
VincentLanglet:strSplit
Jul 21, 2025
Merged

Improve StrSplit returnType#3999
ondrejmirtes merged 1 commit into
phpstan:2.1.xfrom
VincentLanglet:strSplit

Conversation

@VincentLanglet

@VincentLanglet VincentLanglet commented May 18, 2025

Copy link
Copy Markdown
Contributor

@VincentLanglet

Copy link
Copy Markdown
Contributor Author

If it's ok, I opened #4000 first

@VincentLanglet
VincentLanglet force-pushed the strSplit branch 12 times, most recently from c4c4d18 to 14649b5 Compare June 13, 2025 00:27
@VincentLanglet
VincentLanglet marked this pull request as ready for review June 13, 2025 00:40
@phpstan-bot

Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

foreach ($constantStrings as $constantString) {
$value = $constantString->getValue();

if ($encoding === null && $value === '') {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This logic exists to avoid the same issue than phpstan/phpstan#13129

@ondrejmirtes ondrejmirtes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one could also be only for 2.1.x.

Comment thread src/Php/PhpVersion.php Outdated
@VincentLanglet
VincentLanglet force-pushed the strSplit branch 2 times, most recently from 12956d2 to 0e64b28 Compare July 17, 2025 16:43
@VincentLanglet
VincentLanglet changed the base branch from 1.12.x to 2.1.x July 17, 2025 16:43
@VincentLanglet
VincentLanglet force-pushed the strSplit branch 2 times, most recently from 2aeca20 to 80ab977 Compare July 17, 2025 17:36
@VincentLanglet

Copy link
Copy Markdown
Contributor Author

@ondrejmirtes The HasPropertyTypeTest::testIsSuperTypeOf with data set #4 seems random,
On this PR it fails on PHP 8.4 ubuntu,
But on another PR it onl fails on PHP 8.3 ubuntu
https://github.com/phpstan/phpstan-src/actions/runs/16353254353/job/46205186388?pr=3906
And it changes sometimes when I repush.

So I don't think, it's related to the PR ; this is now ready.

@ondrejmirtes
ondrejmirtes merged commit 08264fb into phpstan:2.1.x Jul 21, 2025
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants