protected function calculateExpectedIndent(array $tokens, $stackPtr)
    {
        $conditionStack = array();

        // Empty conditions array (top level structure).
        if (empty($tokens[$stackPtr]['conditions']) === true) {
            return 1;
        }

        $tokenConditions = $tokens[$stackPtr]['conditions'];
        foreach ($tokenConditions as $id => $condition) {
            // If it's an indenting scope ie. it's not in our array of
            // scopes that don't indent, add it to our condition stack.
            if (in_array($condition, $this->nonIndentingScopes) === false) {
                $conditionStack[$id] = $condition;
            }
        }

        return ((count($conditionStack) * $this->indent) + 1);

    }
protected function calculateExpectedIndent(array $tokens, $stackPtr)
    {
        $conditionStack = array();

        // Empty conditions array (top level structure).
        if (empty($tokens[$stackPtr]['conditions']) === true) {
            return 1;
        }

        $tokenConditions = $tokens[$stackPtr]['conditions'];
        foreach ($tokenConditions as $id => $condition) {
            // If it's an indenting scope ie. it's not in our array of
            // scopes that don't indent, add it to our condition stack.
            if (in_array($condition, $this->nonIndentingScopes) === false) {
                $conditionStack[$id] = $condition;
            }
        }

        return ((count($conditionStack) * $this->indent) + 1);

    }
protected function calculateExpectedIndent ( array $ tokens , $ stackPtr ) { $ conditionStack = array ( ) ; // Empty conditions array (top level structure). if ( empty ( $ tokens [ $ stackPtr ] [ 'conditions' ] ) === true ) { return 1 ; } $ tokenConditions = $ tokens [ $ stackPtr ] [ 'conditions' ] ; foreach ( $ tokenConditions as $ id => $ condition ) { // If it's an indenting scope ie. it's not in our array of // scopes that don't indent, add it to our condition stack. if ( in_array ( $ condition , $ this -> nonIndentingScopes ) === false ) { $ conditionStack [ $ id ] = $ condition ; } } return ( ( count ( $ conditionStack ) * $ this -> indent ) + 1 ) ; }
Calculates the expected indent of a token.

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

@return int
Calculates the expected indent of a token .