微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – PSR-2是否需要垂直对齐?

这两者之间允许什么:
$value = 'value';
$user = 'John';
$timestamp = 1480927909;
$day = date('Y-m-d',$timestamp);

要么

$value     = 'value';
$user      = 'John';
$timestamp = 1480927909;
$day       = date('Y-m-d',$timestamp);
PSR-2没有针对这种线间对齐的具体规则:

PSR-2 Conclusion

There are many elements of style and practice intentionally omitted by this guide. These include but are not limited to:

  • Declaration of global variables and global constants
  • Declaration of functions
  • Operators and assignment
  • Inter-line alignment
  • Comments and documentation blocks
  • Class name prefixes and suffixes
  • Best practices

Future recommendations MAY revise and extend this guide to address those or other elements of style and practice.

对于它的价值,PHP-fig Group的行间对齐是discussed for PSR-1,但是从最终版本中删除了:

The way-back original long-form PSR-1 covered inter-line alignment,globals,ternaries,assignment,and lots of other things. Those ended up getting removed for varIoUs reasons; their epitaph is at the conclusion of PSR-2.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐