kalessil / yii2inspections

MIT License
31 stars 3 forks source link

Twitter sync #29

Open kalessil opened 6 years ago

kalessil commented 6 years ago

https://twitter.com/juanmacias/status/997385916267356160

Another suggestion for a new inspection. All ActiveRecord->save() method returns if the model has been saved. You must check it. Many developer don't do it and relay that the method will be successfully always.

https://twitter.com/juanmacias/status/997385573013905408

Yii specific, for objects that inherits ActiveQuery, I use a proxy function to add PHPDoc, for example in this case the class is ActionQuery extends ActiveQuery and the method one() I want to specify that can returns Action (that extends ActiveRecord)

https://twitter.com/juanmacias/status/997384795083739137

Yii specific: Second instruction must be second and is slower