Skip to content

Commit

Permalink
Changelog for #2372 (ref #2371)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Apr 15, 2019
2 parents c383803 + 6e315f1 commit e1dcba4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- Use --filter=gitstaged to check these files
-- You still need to give PHPCS a list of files or directories in which to apply the filter
-- Thanks to Juliette Reinders Folmer for the contribution
- Generic.WhiteSpace.ScopeIndent no longer performs exact indents checking for chained method calls
-- Other sniffs can be used to enforce chained method call indent rules
-- Thanks to Pieter Frenssen for the patch
- PSR2.ControlStructures.ControlStructureSpacing now allows whitespace after the opening parenthesis if followed by a comment
-- Thanks to Michał Bundyra for the patch
- The T_LIST token and it's opening and closing parentheses now contain references to each other in the tokens array
Expand Down
9 changes: 9 additions & 0 deletions src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,15 @@ public function process(File $phpcsFile, $stackPtr)
$exact = true;
}

// Don't perform strict checking on chained method calls since they
// are often covered by custom rules.
if ($checkToken !== null
&& $tokens[$checkToken]['code'] === T_OBJECT_OPERATOR
&& $exact === true
) {
$exact = false;
}

if ($checkIndent === null) {
$checkIndent = $currentIndent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ if ($foo) {
'compression' => $compression,
] = $options;
}

$this->foo()
->bar()
->baz();
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ if ($foo) {
'compression' => $compression,
] = $options;
}

$this->foo()
->bar()
->baz();

0 comments on commit e1dcba4

Please sign in to comment.