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

Class: Generic_Sniffs_WhiteSpace_ScopeIndentSniff

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

Class Overview


Generic_Sniffs_Whitespace_ScopeIndentSniff.


Author(s):

Version:

  • Release: 2.7.1

Copyright:

  • 2006-2014 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 32]
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 60]

Does the indent need to be exactly right?

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

  • Access: public

Type:   bool


[ Top ]

$ignoreIndentationTokens = array()

[line 90]

List of tokens not needing to be checked for indentation.

Useful to allow Sniffs based on this to easily ignore/skip some tokens from verification. For example, inline HTML sections or PHP open/close tags can escape from here and have their own rules elsewhere.

  • Access: public

Type:   int[]


[ Top ]

$indent =  4

[line 50]

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

Type:   int


[ Top ]

$nonIndentingScopes = array()

[line 107]

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

Type:   int[]


[ Top ]

$supportedTokenizers = array(
                                   'PHP',
                                   'JS',
                                  )

[line 40]

A list of tokenizers this sniff supports.
  • Access: public

Type:   array


[ Top ]

$tabIndent =  false

[line 71]

Should tabs be used for indenting?

If TRUE, fixes will be made using tabs instead of spaces. The size of each tab is important, so it should be specified using the --tab-width CLI argument.

  • Access: public

Type:   bool


[ Top ]



Method Detail

process   [line 142]

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

array register( )

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

[ Top ]


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