is there any guide for code formatting rules for Yii3?
For instance inserting variables somewhere in the middle of the code is a bad practice like here - one has to read through file in order to find the variable & definition. Variables should be all at the top.
Also I would suggest to put comments to all public methods.
Another question would be whether it would be possible to use protected properties instead of private to allow flexibility for inheritance. Many PRs in the past have changed private scope to protected.