Home >Backend Development >PHP Tutorial >How do you make function comments?
One is beautiful, the other is clear at a glance
One is beautiful, the other is clear at a glance
<code>/** * 获取分类商品列表 * @param $shop_id 店铺id * @param $cate_id 分类id * @param $page 页码 * @param $per_page 页数 * @return mixed */</code>
This is automatically generated using phpstorm
First of all, comments are for people to understand at a glance, but they have nothing to do with aesthetics. . There are generally two types of comments, one is at the code line level and the other is at the method level. The method level generally requires document comments.
It is recommended to take a look at the PHP PSR code standard programming specification
https://github.com/hfcorriez/...