src/Mutator/MutatorAbstract.php
protected static function getPreviousToken(array &$tokens, $index, array $excludeTokens = [])
    {
        while ($index > 0 && isset($tokens[$index-1])
        && self::shouldSkip($tokens[$index - 1], $excludeTokens)) {
            $index--;
        }

        if (! isset($tokens[$index-1])) {
            return false;
        }

        return is_array($tokens[$index-1]) ? $tokens[$index-1][0] : $tokens[$index-1];
    }
protected static function getPreviousToken(array &$tokens, $index, array $excludeTokens = [])
    {
        while ($index > 0 && isset($tokens[$index-1])
        && self::shouldSkip($tokens[$index - 1], $excludeTokens)) {
            $index--;
        }

        if (! isset($tokens[$index-1])) {
            return false;
        }

        return is_array($tokens[$index-1]) ? $tokens[$index-1][0] : $tokens[$index-1];
    }
protected static function getPreviousToken ( array & $ tokens , $ index , array $ excludeTokens = [ ] ) { while ( $ index > 0 && isset ( $ tokens [ $ index - 1 ] ) && self :: shouldSkip ( $ tokens [ $ index - 1 ] , $ excludeTokens ) ) { $ index -- ; } if ( ! isset ( $ tokens [ $ index - 1 ] ) ) { return false ; } return is_array ( $ tokens [ $ index - 1 ] ) ? $ tokens [ $ index - 1 ] [ 0 ] : $ tokens [ $ index - 1 ] ; }
Finds the next token value in token array before a given index.
@param array $tokens Token array to lookup
@param int $index Position to start lookup at
@param array $excludeTokens Excluded tokens list

@return int|string|false The previous match if found, or false. Token is guaranteed to be a scalar if a match is found.
Finds the next token value in token array before a given index . @param array $tokens Token array to lookup @param int $index Position to start lookup at @param array $excludeTokens Excluded tokens list