-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Labels
Milestone
Description
I think the standard needs to be relaxed a little bit for lambdas (if possible).
For example:
$mapped = array_map(function ($a) { return $a->prop; }, $someObjects);
Will produce two phpcs errors:
- Closing brace must be on a line by itself
- Each PHP statement must be on a line by itself
So then, you might try:
$mapped = array_map(function ($a) {
return $a->prop;
},
$someObjects
);
Which is already terrible but then you get:
- Opening parenthesis of a multi-line function call must be the last content on the line
- Closing brace indented incorrectly; expected 2 spaces, found 3
So you try:
$mapped = array_map(
function ($a) {
return $a->prop;
},
$someObjects
);
And somehow it works but it's hideous.