Skip to content

Conversation

@Afrowson
Copy link
Contributor

@Afrowson Afrowson commented Nov 21, 2024

Since the update to v11.32.0
this commit introduced type hints for the Paginator Class. The @param for $items was defined too narrow, restricting the use of Collections, but they are supported and it seems like to be preffered, as the protected setItems() method which is called from within the constructor is supporting Collections and converts any array in to one.

This is not a bugfix as the code works, but a type fix supporting the usage of phpstan/larastan

This PR broadens the type hint for the param $items to be compatible with setItems() by allowing Collections with Tkey and TValue

I did not add null as allowed, although it is supported in the setItems method, but maybe that should be supported as well?

@taylorotwell taylorotwell merged commit 49df42d into laravel:11.x Nov 21, 2024
34 checks passed
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.

2 participants