コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function process(Tokens $tokens, Token $token, $index)
 {
     if (!$token->equalsAny(array(array(T_CLASS, 'class'), array(T_STRING, 'class')), false)) {
         return;
     }
     $prevIndex = $tokens->getPrevMeaningfulToken($index);
     $prevToken = $tokens[$prevIndex];
     if ($prevToken->isGivenKind(T_DOUBLE_COLON)) {
         $token->override(array(CT::T_CLASS_CONSTANT, $token->getContent()));
     }
 }
コード例 #2
0
ファイル: TokenTest.php プロジェクト: cryode/PHP-CS-Fixer
 /**
  * @dataProvider provideEqualsAny
  */
 public function testEqualsAny($equalsAny, $other, $caseSensitive = true)
 {
     $token = new Token(array(T_FUNCTION, 'function', 1));
     $this->assertSame($equalsAny, $token->equalsAny($other, $caseSensitive));
 }