@@ -370,7 +370,7 @@ function ($item) {
370370 $ nextLineCanBeIndented = false ;
371371 if ($ nestToken ->equalsAny (['; ' , '} ' ])) {
372372 $ nextLineCanBeIndented = true ;
373- } elseif ($ this ->isCommentWithFixableIndendation ($ tokens , $ nestIndex )) {
373+ } elseif ($ this ->isCommentWithFixableIndentation ($ tokens , $ nestIndex )) {
374374 for ($ i = $ nestIndex ; $ i > $ startBraceIndex ; --$ i ) {
375375 if ($ tokens [$ i ]->equalsAny (['; ' , '} ' ])) {
376376 $ nextLineCanBeIndented = true ;
@@ -868,6 +868,16 @@ private function ensureWhitespaceAtIndexAndIndentMultilineComment(Tokens $tokens
868868
869869 $ nextToken = $ tokens [$ nextTokenIndex ];
870870 if ($ nextToken ->isComment ()) {
871+ $ previousToken = $ tokens [$ nextTokenIndex - 1 ];
872+
873+ // do not indent inline comments used to comment out unused code
874+ if (
875+ 0 === strpos ($ nextToken ->getContent (), '// ' .$ this ->whitespacesConfig ->getIndent ())
876+ && $ previousToken ->isWhitespace () && 1 === preg_match ('/\R$/ ' , $ previousToken ->getContent ())
877+ ) {
878+ return ;
879+ }
880+
871881 $ tokens [$ nextTokenIndex ] = new Token ([
872882 $ nextToken ->getId (),
873883 preg_replace (
@@ -912,7 +922,7 @@ private function isMultilined(Tokens $tokens, $startParenthesisIndex, $endParent
912922 *
913923 * @return bool
914924 */
915- private function isCommentWithFixableIndendation (Tokens $ tokens , $ index )
925+ private function isCommentWithFixableIndentation (Tokens $ tokens , $ index )
916926 {
917927 if (!$ tokens [$ index ]->isComment ()) {
918928 return false ;
0 commit comments