Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PSR-2 Coding standard for arrays and method chaining?

Tags:

php

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

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

$rows = DB::select('mytable')
    ->where_id($id)
    ->get_one();
like image 388
Jürgen Paul Avatar asked Aug 10 '12 01:08

Jürgen Paul


People also ask

Is PSR 2 deprecated?

Deprecated - As of 2019-08-10 PSR-2 has been marked as deprecated. PSR-12 is now recommended as an alternative.

What PSR-12?

PSR-12 seeks to provide a set way that both coding style tools can implement, projects can declare adherence to and developers can easily relate on between different projects for these coding style reducing cognitive friction.

What are PSRS in PHP?

The PHP Standard Recommendation (PSR) is a PHP specification published by the PHP Framework Interop Group. Similar to Java Specification Request for Java, it serves the standardization of programming concepts in PHP.


1 Answers

PSR-2 currently doesn't specify either

like image 59
zerkms Avatar answered Sep 20 '22 16:09

zerkms