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

Class: Squiz_Sniffs_WhiteSpace_ScopeIndentSniff

Source Location: /PHP_CodeSniffer-0.7.0/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeIndentSniff.php

Class Overview

Generic_Sniffs_WhiteSpace_ScopeIndentSniff
   |
   --Squiz_Sniffs_WhiteSpace_ScopeIndentSniff

Squiz_Sniffs_Whitespace_ScopeIndentSniff.


Author(s):

Version:

  • Release: 0.7.0

Copyright:

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

Methods


Inherited Variables

Inherited Methods

Class: Generic_Sniffs_WhiteSpace_ScopeIndentSniff

Generic_Sniffs_WhiteSpace_ScopeIndentSniff::calculateExpectedIndent()
Calculates the expected indent of a token.
Generic_Sniffs_WhiteSpace_ScopeIndentSniff::process()
Processes this test, when one of its tokens is encountered.
Generic_Sniffs_WhiteSpace_ScopeIndentSniff::register()
Returns an array of tokens this test wants to listen for.

Class Details

[line 34]
Squiz_Sniffs_Whitespace_ScopeIndentSniff.

Checks that control structures are structured correctly, and their content is indented correctly.



[ Top ]


Method Detail

calculateExpectedIndent   [line 49]

int calculateExpectedIndent( array $tokens, int $stackPtr)

Calculates the expected indent of a token.

Looks for ob_start() calls because those act as scope openers in the Squiz coding standard, and so require additional indentation.

  • Access: protected

Overrides Generic_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 ]


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