コード例 #1
0
ファイル: Addendum.php プロジェクト: maslosoft/addendum
 /**
  * TODO This should not be static
  * @param Reflector $reflection
  * @return mixed[]
  */
 public static function getDocComment(Reflector $reflection)
 {
     // NOTE: Due to a nature of traits, raw doc parsing is always needed
     // When using reflection's method `getDocComment` it will return
     // doc comment like if it was pasted in code. Thus use statement
     // from traits would be omited. See https://github.com/Maslosoft/Addendum/issues/24
     $docComment = new DocComment();
     if ($reflection instanceof ReflectionClass) {
         $commentString = $docComment->get($reflection)['class'];
     } else {
         $commentString = $docComment->get($reflection);
     }
     return $commentString;
 }