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 type resolution for properties via getters and setters #2

Closed AdeAttwood closed 3 years ago

AdeAttwood commented 3 years ago

Psalm will now know the type of magic properties via the getters and getters on a class that extends BaseObject.

function getTest(): int {}

This snippet will new resolve the property test to be the type of int

/** @return ActiveQuery<Test> */
function getTest(): ActiveQuery {}

Also active query classes are resolved to there template type. The above snippet will resolve a property test to be the class type Test