gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-10-31 23:14:44 27 4
gpt4 key购买 nike

这两者之间允许什么:

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

就其值(value)而言,行间对齐是 discussed for PSR-1由 PHP-FIG Group 开发,但已从最终版本中删除:

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.

关于php - PSR-2 是否需要垂直对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40970453/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com