laravel-nestedset icon indicating copy to clipboard operation
laravel-nestedset copied to clipboard

PhpPDoc for magic methods

Open vv12131415 opened this issue 8 years ago • 0 comments

Thanks for the awesome thing! I was building my app and found that there were no hints given by my IDE (PhpStrom), I was using descendantsAndSelf() method. I've made workaround myself. I've put PhpDoc comments as a class comment.

/**
* @method static \Kalnoy\Nestedset\Collection descendantsAndSelf($id)
*/

My suggestion is to create CLI command (or something else) to generate comments for the class that uses this trait.

There is a thing like https://github.com/barryvdh/laravel-ide-helper that might be useful to see how they create PhpDocs for models and facades.

We can also ask people to put this part of comments to their above class comments, but that's just a workaround as I think

vv12131415 avatar Jun 30 '17 19:06 vv12131415