예제 #1
0
파일: Interface.php 프로젝트: rhysr/Docblox
 /**
  * Retrieve the name of the class starting from the T_CLASS token.
  *
  * @param DocBlox_Token_Iterator $tokens
  *
  * @return string
  */
 protected function extractClassName(DocBlox_Token_Iterator $tokens)
 {
     // a class name can be a combination of a T_NAMESPACE and T_STRING
     $name = '';
     while ($token = $tokens->next()) {
         if (!in_array($token->type, array(T_WHITESPACE, T_STRING, T_NS_SEPARATOR))) {
             $tokens->previous();
             break;
         }
         $name .= $token->content;
     }
     return trim($name);
 }