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

Class: Generic_Sniffs_WhiteSpace_ScopeIndentSniff

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

Class Overview


Generic_Sniffs_Whitespace_ScopeIndentSniff.


Author(s):

Version:

  • Release: 0.9.0

Copyright:

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

Variables

Methods


Child classes:

Squiz_Sniffs_WhiteSpace_ScopeIndentSniff
Squiz_Sniffs_Whitespace_ScopeIndentSniff.
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

$indent =  4

[line 41]

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

Type:   int


[ Top ]

$nonIndentingScopes = array()

[line 48]

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

Type:   array(int)


[ Top ]



Method Detail

calculateExpectedIndent   [line 254]

int calculateExpectedIndent( array $tokens, int $stackPtr)

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

Overridden in child classes as:

Squiz_Sniffs_WhiteSpace_ScopeIndentSniff::calculateExpectedIndent()
Calculates the expected indent of a token.

Parameters:

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

[ Top ]

process   [line 72]

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 56]

array register( )

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

[ Top ]


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