Home >Backend Development >PHP Tutorial >How do you make function comments?

How do you make function comments?

WBOY
WBOYOriginal
2016-09-15 11:30:541145browse

One is beautiful, the other is clear at a glance

Reply content:

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/...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn