Skip to content

Add Type::sliceArray()#3514

Merged
ondrejmirtes merged 2 commits intophpstan:1.12.xfrom
herndlm:slice-array
Oct 6, 2024
Merged

Add Type::sliceArray()#3514
ondrejmirtes merged 2 commits intophpstan:1.12.xfrom
herndlm:slice-array

Conversation

@herndlm
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
Copy link
Copy Markdown
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.

5 participants