PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::skipNonArrayElements PHP Метод

skipNonArrayElements() приватный Метод

Method to move index over the non-array elements like function calls or function declarations.
private skipNonArrayElements ( integer $index, Tokens $tokens ) : integer
$index integer
$tokens PhpCsFixer\Tokenizer\Tokens
Результат integer New index
    private function skipNonArrayElements($index, Tokens $tokens)
    {
        if ($tokens[$index]->equals('}')) {
            return $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index, false);
        }
        if ($tokens[$index]->equals(')')) {
            $startIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $index, false);
            $startIndex = $tokens->getPrevMeaningfulToken($startIndex);
            if (!$tokens[$startIndex]->isGivenKind(array(T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN))) {
                return $startIndex;
            }
        }
        return $index;
    }