/**
  * Find the appropriate docblock.
  *
  * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
  * @param \TokenReflection\IReflection $parent Parent reflection
  * @return \TokenReflection\ReflectionElement
  */
 protected function parseDocComment(Stream $tokenStream, IReflection $parent)
 {
     if (!$tokenStream->is(T_NAMESPACE)) {
         $this->docComment = new ReflectionAnnotation($this);
         return $this;
     } else {
         return parent::parseDocComment($tokenStream, $parent);
     }
 }
예제 #2
0
 /**
  * Parses reflected element metadata from the token stream.
  *
  * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
  * @param \TokenReflection\IReflection $parent Parent reflection object
  * @return \TokenReflection\ReflectionConstant
  */
 protected function parse(Stream $tokenStream, IReflection $parent)
 {
     if ($tokenStream->is(T_CONST)) {
         $tokenStream->skipWhitespaces(true);
     }
     if (false === $this->docComment->getDocComment()) {
         parent::parseDocComment($tokenStream, $parent);
     }
     return $this->parseName($tokenStream)->parseValue($tokenStream, $parent);
 }