PHP 代码规范 (Rohn Style)

2016-08-26  本文已影响75人  Rohn

PHP 代码文件

命名规则

布局

class HelloWord
{
        function __construct()
        {
                echo 'hello world';
        }
}
if ($hello_world == true) {//()两端外界都有一个空格
      //控制主体
}//与if对齐

function helloWorld (){} //()前面的空格

function helloWorld($arg1, &$arg2, $arg3='test'){}

function multLines(
      $arg1,
      &$arg2,
      $arg3='test'
){}

其他


更多细节可参考 PSR

上一篇 下一篇

猜你喜欢

热点阅读