public function getLineLength(PHP_CodeSniffer_File $phpcsFile, $currentLine) {
    $tokens = $phpcsFile->getTokens();

    $tokenCount = 0;
    $currentLineContent = '';

    $trim = (strlen($phpcsFile->eolChar) * -1);
    for (; $tokenCount < $phpcsFile->numTokens; $tokenCount++) {
      if ($tokens[$tokenCount]['line'] === $currentLine) {
        $currentLineContent .= $tokens[$tokenCount]['content'];
      }
    }

    return strlen($currentLineContent);
  }
public function getLineLength(PHP_CodeSniffer_File $phpcsFile, $currentLine) {
    $tokens = $phpcsFile->getTokens();

    $tokenCount = 0;
    $currentLineContent = '';

    $trim = (strlen($phpcsFile->eolChar) * -1);
    for (; $tokenCount < $phpcsFile->numTokens; $tokenCount++) {
      if ($tokens[$tokenCount]['line'] === $currentLine) {
        $currentLineContent .= $tokens[$tokenCount]['content'];
      }
    }

    return strlen($currentLineContent);
  }
public function getLineLength ( PHP_CodeSniffer_File $ phpcsFile , $ currentLine ) { $ tokens = $ phpcsFile -> getTokens ( ) ; $ tokenCount = 0 ; $ currentLineContent = '' ; $ trim = ( strlen ( $ phpcsFile -> eolChar ) * - 1 ) ; for ( ; $ tokenCount < $ phpcsFile -> numTokens ; $ tokenCount ++ ) { if ( $ tokens [ $ tokenCount ] [ 'line' ] === $ currentLine ) { $ currentLineContent .= $ tokens [ $ tokenCount ] [ 'content' ] ; } } return strlen ( $ currentLineContent ) ; }
Returns the length of a defined line.

@return integer
Returns the length of a defined line .