Exemplo n.º 1
0
 public function testUnanotatedClassCanHaveAnotatedField()
 {
     $reflection = new ReflectionClass('SomeOtherClass');
     $property = $reflection->getProperty('field1');
     $finder = new DocComment();
     $this->assertEqual($finder->get($property), '/** field doccomment */');
 }
Exemplo n.º 2
0
 public static function getDocComment($reflection)
 {
     if (self::checkRawDocCommentParsingNeeded()) {
         $docComment = new DocComment();
         return $docComment->get($reflection);
     }
     return $reflection->getDocComment();
 }
Exemplo n.º 3
0
 public static function clearCache()
 {
     self::$classes = array();
     self::$methods = array();
     self::$fields = array();
     self::$parsedFiles = array();
 }
Exemplo n.º 4
0
 static function parseMethods($class)
 {
     $rc = new \ReflectionClass($class);
     foreach ($rc->getMethods() as $m) {
         (yield $m => DocComment::parse($m->getDocComment()));
     }
 }
Exemplo n.º 5
0
 public static function getDocComment($reflection)
 {
     $value = false;
     if (self::checkRawDocCommentParsingNeeded()) {
         $docComment = new DocComment();
         $value = $docComment->get($reflection);
     } else {
         $value = $reflection->getDocComment();
     }
     if ($value) {
         // get rid of useless '*' and white space from line's start
         // this will allow dividing of one annotation to multiple lines
         $value = preg_replace('/^[\\s*]*/m', '', $value);
     }
     return $value;
 }
Exemplo n.º 6
0
 public function testRawComment()
 {
     $doc = new DocComment(self::DOC_BLOCK);
     $this->assertSame(self::DOC_BLOCK, $doc->getRawComment());
 }