coding-standards
coding-standards copied to clipboard
Formatting inline array and closures
There are a few formats that seem to be gaining popularity. See the following examples:
// Inline array.
$foo = bar($arg1, array(
'one',
'two',
'three',
), $arg3);
// Inline closure.
$container->share('database', function(Container $c) {
// Return a database driver.
}, true);
How do people feel about those cases?
Yes, that's actually a clarification point on an upcoming PSR-2 Errata doc
—
Sent from Mailbox for iPhone
On Sat, Aug 31, 2013 at 9:33 PM, Andrew Eddie [email protected] wrote:
There are a few formats that seem to be gaining popularity. See the following examples:
// Inline array. $foo = bar($arg1, array( 'one', 'two', 'three', ), $arg3); // Inline closure. $container->share('database', function(Container $c) { // Return a database driver. }, true);
How do people feel about those cases?
Reply to this email directly or view it on GitHub: https://github.com/joomla/coding-standards/issues/30
I prefer these over
$foo = bar(
$arg1,
array(
'one',
'two',
'three',
),
$arg3
);
:+1: