docBlockFactory = $docBlockFactory; } /** * Update the Swagger information with information from the DocBlock comment. * * @param \ReflectionProperty $reflectionProperty * @param Items|Schema $property */ public function updateWithPhpdoc(\ReflectionProperty $reflectionProperty, $property) { try { $docBlock = $this->docBlockFactory->create($reflectionProperty); } catch (\Exception $e) { // ignore return; } if (!$title = $docBlock->getSummary()) { /** @var Var_ $var */ foreach ($docBlock->getTagsByName('var') as $var) { if (!$description = $var->getDescription()) { continue; } $title = $description->render(); if ($title) break; } } if ($property->getTitle() === null && $title) { $property->setTitle($title); } if ($property->getDescription() === null && $docBlock->getDescription() && $docBlock->getDescription()->render()) { $property->setDescription($docBlock->getDescription()->render()); } } }