/**
  * Clear comment token, but preserve trailing linebreak if there is any.
  *
  * @param Tokens $tokens
  * @param int    $index  T_COMMENT index
  *
  * @deprecated Will be removed in the 2.0
  */
 private function clearCommentToken(Tokens $tokens, $index)
 {
     if ("\n" !== substr($tokens[$index]->getContent(), -1, 1)) {
         $tokens->clearTokenAndMergeSurroundingWhitespace($index);
         return;
     }
     // if previous not-cleared token is whitespace;
     // append line break to content
     $previous = $tokens->getNonEmptySibling($index, -1);
     if ($tokens[$previous]->isWhitespace()) {
         $tokens[$previous]->setContent($tokens[$previous]->getContent() . "\n");
         $tokens->clearTokenAndMergeSurroundingWhitespace($index);
         return;
     }
     // elseif the next not-cleared token is whitespace;
     // prepend with line break
     $next = $tokens->getNonEmptySibling($index, 1);
     if (null !== $next && $tokens[$next]->isWhitespace()) {
         $tokens[$next]->setContent("\n" . $tokens[$next]->getContent());
         $tokens->clearTokenAndMergeSurroundingWhitespace($index);
         return;
     }
     // else
     // override with whitespace token linebreak
     $tokens->overrideAt($index, array(T_WHITESPACE, "\n", $tokens[$index]->getLine()));
 }