Example #1
0
 protected function matchTokens(Token $t1, Token $t2)
 {
     // Comparing T_OPEN_TAG with T_CLOSE_TAG
     if ($t2->getType() == Token::T_CLOSE_TAG) {
         if ($t1->getNamespace() == $t2->getNamespace() && $t1->getName() == $t2->getName()) {
             return true;
         }
         // Comparing T_OPEN_TAG with T_CLOSE
     } elseif ($t2->getType() == Token::T_CLOSE) {
         return true;
     }
     return false;
 }