Description:
------------
When having closures with a long "use" statement (too long to
be on one line), we need to use multi-
line arguments. Then, the closing use characters ) and the
function's opening bracket { are also on a
line of their own.
The issue is the indentation for this last line composed of ") {":
if the closure is in a simple file, at the
first level of indentation, no issue. But if the closure is inside a
function, a class method, or anything
else you might think of, PHPCS expects 4 more spaces than it
should at the beginning of the line.
You'll find examples in the gist below. The standard used is
PSR2.
Test script:
---------------
https://gist.github.com/gnutix/6291918
Expected result:
----------------
user@server:~$ phpcs test.php --standard=PSR2
Time: 33 ms, Memory: 5.50Mb
Actual result:
--------------
user@server:~$ phpcs test.php --standard=PSR2
FILE: /home/user/test.php
------------------------------------------------------------------------
--------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
------------------------------------------------------------------------
--------
13 | ERROR | Multi-line function declaration not indented
correctly;
| | expected 8 spaces but found 4
------------------------------------------------------------------------
--------
Time: 33 ms, Memory: 5.50Mb