Closed
Description
Hello,
I'm using Sniffer to lint the test code which is using Codeception\Specify in the code.
Problem
When doing this:
class Dummy extends Unit
{
use Specify;
public function foo()
{
$this->specify('some
long description', function () {
echo 'hello';
});
}
}
After running phpcbf
class Dummy extends Unit
{
use Specify;
public function foo()
{
$this->specify('some
long description', function () {
echo 'hello';
}); // <----- wrong indent
}
}
What I expected
Sniff should not adjust the indent of the first code.
Solution ?
Should we include T_CONSTANT_ENCAPSED_STRING
when finding the first token position of the line ?
// ScopeIndentSniff.php, Line 589
if (isset($tokens[$scopeCloser]['scope_condition']) === true) {
$first = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_CONSTANT_ENCAPSED_STRING], $tokens[$scopeCloser]['scope_condition'], true);
$currentIndent = ($tokens[$first]['column'] - 1);
// ...