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

Add Type::sliceArray() #3514

Merged
merged 2 commits into from
Oct 6, 2024
Merged

Add Type::sliceArray() #3514

merged 2 commits into from
Oct 6, 2024

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Sep 29, 2024

Improves type specification edge cases slightly, but there is more potential which I definitely don't want to get into here (e.g. currently $offsetType and $lengthType are only used for constant arrays if they are of type ConstantIntegerType).

The test change is correct I believe, those array slices might not be lists, see 3v4l.org/hAv10

I dislike the 2 new instanceof self checks, but they are only for BC and can be removed / will not be there in 2.0

@herndlm herndlm marked this pull request as draft September 29, 2024 19:31
@herndlm herndlm force-pushed the slice-array branch 3 times, most recently from e44aaa5 to d00a015 Compare September 29, 2024 19:46
@herndlm herndlm marked this pull request as ready for review September 29, 2024 19:46
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 7f19560 into phpstan:1.12.x Oct 6, 2024
481 of 499 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@herndlm herndlm deleted the slice-array branch October 6, 2024 14:49
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.

None yet

5 participants