代码注释一直都在写,可是总是那么的不符合规则,又不想写文档,这个可就麻烦了,花点时间好好的编辑下eclipse for php developer 里面的php代码模板,参考了zend framework的注释规则,贴一些出来以便自己遵守,写注释的习惯一定要养成,方便自己方便他人。

0.代码的版权注释,公司都有规定的版权,编辑好的模板都带上

PHP code annotation -  PHP代码注释

1.类注释  使用了 uses  category  package copyright license 等

PHP code annotation -  PHP代码注释

2.单行注释 see

PHP code annotation -  PHP代码注释

3.单行注释 //

PHP code annotation -  PHP代码注释

4. 单行注释 /*

PHP code annotation -  PHP代码注释

5.使用@link 引入

PHP code annotation -  PHP代码注释

6.使用<code></code>标签来注释方法

PHP code annotation -  PHP代码注释

7.返回一个对象类型

PHP code annotation -  PHP代码注释

 

最后转下 PHP 注释规范的文档大家可以参考下 ,安装下phpdocumentor还是很必要的

http://www.laruence.com/2009/04/21/680.html

相关文章:

  • 2022-01-12
  • 2021-09-02
  • 2022-12-23
  • 2022-03-02
  • 2021-11-20
  • 2021-11-20
  • 2022-02-20
猜你喜欢
  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案