PhpCsFixer\Tokenizer\TokensAnalyzer::isArray PHP Method

isArray() public method

Check if there is an array at given index.
public isArray ( integer $index ) : boolean
$index integer
return boolean
    public function isArray($index)
    {
        return $this->tokens[$index]->isGivenKind(array(T_ARRAY, CT::T_ARRAY_SQUARE_BRACE_OPEN));
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function fix(\SplFileInfo $file, Tokens $tokens)
 {
     $tokensAnalyzer = new TokensAnalyzer($tokens);
     for ($index = $tokens->count() - 1; $index >= 0; --$index) {
         if ($tokensAnalyzer->isArray($index)) {
             $this->fixArray($tokens, $index);
         }
     }
 }
All Usage Examples Of PhpCsFixer\Tokenizer\TokensAnalyzer::isArray