コード例 #1
0
ファイル: DocParser.php プロジェクト: alejofix/Gape
 /**
  * ArrayEntry ::= Value | KeyValuePair
  * KeyValuePair ::= Key "=" PlainValue
  * Key ::= string | integer
  *
  * @return array
  */
 private function ArrayEntry()
 {
     $peek = $this->lexer->glimpse();
     if (DocLexer::T_EQUALS === $peek['type']) {
         $this->match($this->lexer->isNextToken(DocLexer::T_INTEGER) ? DocLexer::T_INTEGER : DocLexer::T_STRING);
         $key = $this->lexer->token['value'];
         $this->match(DocLexer::T_EQUALS);
         return array($key, $this->PlainValue());
     }
     return array(null, $this->Value());
 }
コード例 #2
0
ファイル: DocParser.php プロジェクト: pollux1er/dlawebdev2
 /**
  * ArrayEntry ::= Value | KeyValuePair
  * KeyValuePair ::= Key ("=" | ":") PlainValue
  * Key ::= string | integer
  *
  * @return array
  */
 private function ArrayEntry()
 {
     $peek = $this->lexer->glimpse();
     if (DocLexer::T_EQUALS === $peek['type'] || DocLexer::T_COLON === $peek['type']) {
         $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING));
         $key = $this->lexer->token['value'];
         $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON));
         return array($key, $this->PlainValue());
     }
     return array(null, $this->Value());
 }
コード例 #3
0
ファイル: DocParser.php プロジェクト: ud223/yj
 /**
  * ArrayEntry ::= Value | KeyValuePair
  * KeyValuePair ::= Key ("=" | ":") PlainValue | Constant
  * Key ::= string | integer | Constant
  *
  * @return array
  */
 private function ArrayEntry()
 {
     $peek = $this->lexer->glimpse();
     if (DocLexer::T_EQUALS === $peek['type'] || DocLexer::T_COLON === $peek['type']) {
         if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
             $key = $this->Constant();
         } else {
             $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING));
             $key = $this->lexer->token['value'];
         }
         $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON));
         return array($key, $this->PlainValue());
     }
     return array(null, $this->Value());
 }
コード例 #4
0
 /**
  * @test
  */
 public function test_parse_return_primitive_alias()
 {
     $comment = '
         /**
          * @Select
          *
          * foo, bar, baz
          *
          * @return int
          */
     ';
     $lexer = new \Doctrine\Common\Annotations\DocLexer();
     $lexer->setInput($comment);
     $tokens = [];
     while ($lexer->moveNext()) {
         $tokens[] = $lexer->lookahead;
     }
 }