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

Class: Generic_Sniffs_WhiteSpace_ScopeIndentSniff

Source Location: /PHP_CodeSniffer-1.3.0/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php

Class Overview


Generic_Sniffs_Whitespace_ScopeIndentSniff.


Author(s):

Version:

  • Release: 1.3.0

Copyright:

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

Variables

Methods


Child classes:

PEAR_Sniffs_WhiteSpace_ScopeIndentSniff
PEAR_Sniffs_Whitespace_ScopeIndentSniff.

Inherited Variables

Inherited Methods


Class Details

[line 33]
Generic_Sniffs_Whitespace_ScopeIndentSniff.

Checks that control structures are structured correctly, and their content is indented correctly. This sniff will throw errors if tabs are used for indentation rather than spaces.



[ Top ]


Class Variables

$exact =  false

[line 51]

Does the indent need to be exactly right.

If TRUE, indent needs to be exactly $ident spaces. If FALSE, indent needs to be at least $ident spaces (but can be more).

  • Access: public

Type:   bool


[ Top ]

$indent =  4

[line 41]

The number of spaces code should be indented.
  • Access: public

Type:   int


[ Top ]

$nonIndentingScopes = array()

[line 58]

Any scope openers that should not cause an indent.
  • Access: protected

Type:   array(int)


[ Top ]



Method Detail

calculateExpectedIndent   [line 302]

int calculateExpectedIndent( array $tokens, int $stackPtr)

Calculates the expected indent of a token.
  • Access: protected

Parameters:

array   $tokens   —  The stack of tokens for this file.
int   $stackPtr   —  The position of the token to get indent for.

[ Top ]

process   [line 82]

void process( PHP_CodeSniffer_File $phpcsFile, int $stackPtr)

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

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  All the tokens found in the document.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.

[ Top ]

register   [line 66]

array register( )

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

[ Top ]


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