code: private function getNewLineIndex($index, Tokens $tokens)
      {
          $lineEnding = $this->whitespacesConfig->getLineEnding();
  
          for ($index, $count = \count($tokens); $index < $count; ++$index) {
              if (false !== strstr($tokens[$index]->getContent(), $lineEnding)) {
                  return $index;
              }
          }
  
          return $index;
      }
docs: Find the index for the new line. Return the given index when there's no new line.
  
  @param int $index
  
  @return int