PSR-2 Coding standard for arrays and method chaining?

前端 未结 2 739
半阙折子戏
半阙折子戏 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:29

    At this stage neither of those are explicitly covered in the PSR-2 standard. In the conclusion it does note that a number of areas are intentionally omitted, including:

    • Operators and assignment
    • Inter-line alignment

    The only relevant guidelines would be the more general ones regarding things like line lengths and number of spaces for indenting.

    Other standards that do deal with those subjects include PEAR and Zend.

提交回复
热议问题