Пример #1
0
 /**
  * @param \ReflectionClass|\ReflectionMethod $reflection
  * @param DocInfo $docInfo
  * @param CodeEntity $code
  */
 public function applyInfoToEntity($reflection, DocInfo $docInfo, CodeEntity $code)
 {
     $code->setName($reflection->getName());
     $code->setDescription($docInfo->getDescription());
     $code->setExample($docInfo->getExample());
     if ($docInfo->getDeprecationMessage()) {
         $code->isDeprecated(true);
         $code->setDeprecationMessage($docInfo->getDeprecationMessage());
     }
 }
 /**
  * @param \ReflectionClass|\ReflectionMethod $reflection
  * @param CodeEntity $code
  * @return array
  */
 private function createEntity($reflection, $code)
 {
     $comment = $this->getCleanDocComment($reflection);
     $tags = $this->extractTagsFromComment($comment, 'description', $reflection);
     $code->setName($reflection->getName());
     $code->setDescription(!empty($tags['description']) ? $tags['description'] : '');
     $code->setExample(!empty($tags['example']) ? $tags['example'] : '');
     if (!empty($tags['deprecated'])) {
         $code->isDeprecated(true);
         $code->setDeprecationMessage($tags['deprecated']);
     }
     return $tags;
 }