arnoson
November 17, 2025, 2:00pm
1
I read that type hints for collections (using foreach) should work now. But when I try out the example described here , VSCode complains about a wrong type (it infers TPage instead of Kirby\Cms\Page).
I’m using the newst version of VSCode with the PHP Intelephense plugin . Am I missing something here or is there another recommended plugin for VSCode?
texnixe
November 17, 2025, 6:24pm
2
This comes from here: $pages->children() | Kirby CMS
TPage: This is a type variable, in this case, a type representing a page.
arnoson
November 18, 2025, 9:28am
3
And do you have any idea why VSCode/Intelephense is struggling with the type variable?
arnoson
November 21, 2025, 10:00am
4
After updating to the latest Kirby version and the latest Intelephense release from 1 day ago, everything works as expected!