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

Class: ScopeIndentSniff

Source Location: /PHP_CodeSniffer-3.1.1/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php

Class Overview


Checks that control structures are defined and indented correctly.


Author(s):

Copyright:

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

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 17]
Checks that control structures are defined and indented correctly.


[ Top ]


Class Variables

$exact =  false

[line 45]

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:   boolean


[ Top ]

$ignoreIndentationTokens = array()

[line 75]

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

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

Type:   integer


[ Top ]

$nonIndentingScopes = array()

[line 92]

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

Type:   int[]


[ Top ]

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

[line 25]

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

Type:   array


[ Top ]

$tabIndent =  false

[line 56]

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:   boolean


[ Top ]



Method Detail

process   [line 127]

void process( File $phpcsFile, int $stackPtr)

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

Parameters:

\PHP_CodeSniffer\Files\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 107]

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:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.