php-mode
php-mode copied to clipboard
Indent callback functions
Not sure if it's a bug, but this leads to inconsistent indentation. These codes will be indented differently:
array_map(function() {
process();
}, [1, 2, 3])
array_map(function() use ($foo) {
process();
}, [1, 2, 3])
When an object function accepts a callback function, the indent is inconsistent as well.
$users->each(function($user) {
do_something();
});
$users->each(function($user) use ($foo) {
do_something();
});
Is there anything I can do to fix this? I'm using the default indent mode.
Thanks!
Thank you for the information. I will look into to it soon-ish and try to provide you a solution to achieve the desired indentation.
This is slightly related to #199, which is fixed by 801a2d5 but only in a very dissatisfactory manner. I plan on finding a better solution for this issue and #199 upcoming holidays - if nobody beats me to it of course.