Currently, PHP does not have property support as it works in for example C#.
Yii1/2 has an elegant solution where this functionality implemented using __set and __get.
In Yii3 developers try to abandon this convenient feature, and there is a reasons for that.
- We are unable to have completely own hierarchy, we need to inherit from Yii classes.
- We can not use our code outside Yii framework
- We can not see if property is read-only or write-only
My solution problems:
- To implement property functionality as trait.
- Move trait to very compact library, for example yii/foundation.
- This could be solved with PHPStorm plugin
So internal framework classes would use trait.
User will be able to choose to use just public class fields or use yii/foundation dependancy.