You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement the types for Pagination in Laravel, but I'm running into some issues with mixins.
It seems that types aren't resolved when a concrete class with a generic has a mixin and passes the generic through.
I've attached an example on phpstan.org that explains the situation.
Not sure if this is a bug or a feature request. Would be happy to try and solve this issue with some directions though!
@@ @@-PHP 8.0 – 8.2 (1 error)+PHP 8.0 – 8.2
==========
-57: Expected type array<MyObject>, actual: array<TValue of object (class Paginator, parameter)>+No errors-PHP 7.1 – 7.4 (3 errors)+PHP 7.1 – 7.4 (2 errors)
==========
13: Promoted properties are supported only on PHP 8.0 and later.
-41: Promoted properties are supported only on PHP 8.0 and later.-57: Expected type array<MyObject>, actual: array<TValue of object (class Paginator, parameter)>+41: Promoted properties are supported only on PHP 8.0 and later.
Full report
PHP 8.0 – 8.2
No errors
PHP 7.1 – 7.4 (2 errors)
Line
Error
13
Promoted properties are supported only on PHP 8.0 and later.
41
Promoted properties are supported only on PHP 8.0 and later.
Bug report
I'm trying to implement the types for Pagination in Laravel, but I'm running into some issues with mixins.
It seems that types aren't resolved when a concrete class with a generic has a mixin and passes the generic through.
I've attached an example on phpstan.org that explains the situation.
Not sure if this is a bug or a feature request. Would be happy to try and solve this issue with some directions though!
Code snippet that reproduces the problem
https://phpstan.org/r/6bc14eb5-a2ad-46be-923e-c33c7441317a
Expected output
The text was updated successfully, but these errors were encountered: