Exemplo n.º 1
0
  protected function processConst($tokens)
  {
    $this->resetTimer('const');

    $constant = new DocBlox_Reflection_Constant();
    $constant->parseTokenizer($tokens);
    $constant->setNamespace($this->getNamespace());
    $this->constants[] = $constant;

    $this->debugTimer('>> Processed class constant '.$constant->getName(), 'const');
  }
Exemplo n.º 2
0
 /**
  * Parses any T_STRING token to find generic keywords to process.
  *
  * This token is used to find any:
  *
  * * `define`, thus constants which are defined using the define keyword
  * * Globals
  *
  * @param DocBlox_Reflection_TokenIterator $tokens Tokens to interpret with the
  *      pointer at the token to be processed.
  *
  * @todo implement globals support since the exact algorythm needs to be
  *      defined, see GH #68
  *
  * @return void
  */
 protected function processString(DocBlox_Reflection_TokenIterator $tokens)
 {
     /** @var DocBlox_Reflection_Token $token  */
     $token = $tokens->current();
     switch ($token->content) {
         case 'define':
             $this->resetTimer('constant');
             $constant = new DocBlox_Reflection_Constant();
             $constant->setFilename($this->filename);
             $constant->setNamespace($this->active_namespace);
             $constant->setNamespaceAliases($this->namespace_aliases);
             $constant->setDefaultPackageName($this->getDefaultPackageName());
             $constant->parseTokenizer($tokens);
             $this->debugTimer('>> Processed define: ' . $constant->getName(), 'constant');
             $this->constants[$constant->getName()] = $constant;
             break;
     }
 }
Exemplo n.º 3
0
  protected function processConst(DocBlox_TokenIterator $tokens)
  {
    $this->resetTimer('constant');

    $constant = new DocBlox_Reflection_Constant();
    $constant->setNamespace($this->active_namespace);
    $constant->parseTokenizer($tokens);

    $this->debugTimer('>> Processed constant '.$constant->getName(), 'constant');

    $this->constants[$constant->getName()] = $constant;
  }