silverleague / silverstripe-ideannotator

Generate docblocks for DataObjects, Page, PageControllers and (Data)Extensions
BSD 3-Clause "New" or "Revised" License
46 stars 24 forks source link

generics #170

Open lekoala opened 2 days ago

lekoala commented 2 days ago

hi,

recently upgraded my project to ss 5.3

is there any plan to change things for @method blocks ?

thanks :)

Firesphere commented 1 day ago

Not that I'm aware of... Is there anything that needs changing for 5.3? I hadn't noticed any problems...

lekoala commented 1 day ago

well, they don't need changing, but they really benefit from it eg

becomes

i have this project where i use phpstan and this really helped a lot

lekoala commented 1 day ago

in ss5.3, they also added things like

which implies that any class extending Extension should specify what T is (really annoying, but easy to automate)

more difficult, we have this

and this is where it gets messy, because pages are mixins within controllers, and I didn't manage to get something that makes phpstan happy so far (it's probably a right mix of extends/implements rules to find)

https://phpstan.org/blog/generics-in-php-using-phpdocs#class-level-generics

Firesphere commented 16 hours ago

Ah, that sounds useful indeed. I'm currently not living in the Silverstripe world much, so I've not kept up with the latest changes :)