public function testUnanotatedClassCanHaveAnotatedField() { $reflection = new ReflectionClass('SomeOtherClass'); $property = $reflection->getProperty('field1'); $finder = new DocComment(); $this->assertEqual($finder->get($property), '/** field doccomment */'); }
public static function getDocComment($reflection) { if (self::checkRawDocCommentParsingNeeded()) { $docComment = new DocComment(); return $docComment->get($reflection); } return $reflection->getDocComment(); }
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; }