PSR-2 Coding standard for arrays and method chaining?

前端 未结 2 754
半阙折子戏
半阙折子戏 2021-02-19 16:03

What\'s the PSR-2 Standard coding convention for initialization of arrays and method chaining?

$foo = array(
    \'one\' => 1,
    \'two\' => 2
);

$rows =         


        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-19 16:23

    PSR-2 currently doesn't specify neither

    PS: even in new standards (when having BC cannot be a justification) PHP cannot be straightforward and there are confusing requirements like:

    When present, the abstract and final declarations MUST precede the visibility declaration.

    When present, the static declaration MUST come after the visibility declaration.

    Stay classy, PHP

提交回复
热议问题