コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function fix(\SplFileInfo $file, Tokens $tokens)
 {
     $tokensAnalyzer = new TokensAnalyzer($tokens);
     for ($index = 0, $c = $tokens->count(); $index < $c; ++$index) {
         if ($tokensAnalyzer->isArray($index)) {
             $this->fixArray($tokens, $index);
         }
     }
 }
コード例 #2
0
 /**
  * @dataProvider provideArrayExceptions
  */
 public function testIsNotArray($source, $tokenIndex)
 {
     $tokens = Tokens::fromCode($source);
     $tokensAnalyzer = new TokensAnalyzer($tokens);
     $this->assertFalse($tokensAnalyzer->isArray($tokenIndex));
 }