Practically / PsalmPluginYii2

Psalm plugin for a better typed yii2 application
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

feat: add multiple return type from ActiveRecord #3

Closed AdeAttwood closed 3 years ago

AdeAttwood commented 3 years ago

You now need to add if the active record return type is multiple or not. You can define the return type like.

/** @return ActiveRecord<User, true> */

This will define that all magic getters will return an array<array-key, User> if false is passed, then the magic getter is a hasOne relation and will return a single user

StuTheWebGuy commented 3 years ago

All good stuff!