-
-
Notifications
You must be signed in to change notification settings - Fork 83
Fix $offset type in ItemList::offsetExists #914
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
base: main
Are you sure you want to change the base?
Conversation
|
Did this fix the issue for you? Because I don't think the problem is the generic template here but someplace else |
|
@mstrelan can you test my commit? |
|
@mglaman that didn't work, tested a few times clearing phpstan cache in between No patches: 447 errors These are the additional errors: |
|
I never answered your first question. Yes, the original commit fixed the issue for me. Subsequent commits have undone that. |
Running phpstan against core with
checkFunctionArgumentTypes: trueresults in several instances of this error:Mostly in
ComputedItemListTrait, but also once inCommentFieldItemList.This is because
\Drupal\Core\TypedData\ListInterfaceextends\ArrayAccesswhich definesTKeyas the param type for$offset. We need to define whatTKeyis in theListInterfacestub.Steps to reproduce
composer installcheckFunctionArgumentTypes: trueto this tocore/phpstan.neon.dist