apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: LineLengthSniff

Source Location: /PHP_CodeSniffer-3.1.1/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php

Class Overview


Checks the length of all lines in a file.


Author(s):

Copyright:

  • 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 19]
Checks the length of all lines in a file.

Checks all lines in the file, and throws warnings if they are over 80 characters in length and errors if they are over 100. Both these figures can be changed in a ruleset.xml file.



[ Top ]


Class Variables

$absoluteLineLimit =  100

[line 36]

The limit that the length of a line must not exceed.

Set to zero (0) to disable.

  • Access: public

Type:   integer


[ Top ]

$ignoreComments =  false

[line 43]

Whether or not to ignore comment lines.
  • Access: public

Type:   boolean


[ Top ]

$lineLimit =  80

[line 27]

The limit that the length of a line should not exceed.
  • Access: public

Type:   integer


[ Top ]



Method Detail

checkLineLength   [line 93]

null|false checkLineLength( \PHP_CodeSniffer\Files\File $phpcsFile, array $tokens, int $stackPtr)

Checks if a line is too long.
  • Access: protected

Parameters:

\PHP_CodeSniffer\Files\File   $phpcsFile   —  The file being scanned.
array   $tokens   —  The token stack.
int   $stackPtr   —  The first token on the next line.

[ Top ]

process   [line 67]

int process( File $phpcsFile, int $stackPtr)

Processes this test, when one of its tokens is encountered.
  • Access: public

Parameters:

\PHP_CodeSniffer\Files\File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.

[ Top ]

register   [line 51]

array register( )

Returns an array of tokens this test wants to listen for.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:27:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.