docBlockFactory = DocBlockFactory::createInstance(); } /** * Update the Swagger information with information from the DocBlock comment. */ public function updateProperty($reflection, OA\Property $property): void { try { $docBlock = $this->docBlockFactory->create($reflection); } catch (\Exception $e) { // ignore return; } if (!$title = $docBlock->getSummary()) { /** @var Var_ $var */ foreach ($docBlock->getTagsByName('var') as $var) { if (!method_exists($var, 'getDescription') || !$description = $var->getDescription()) { continue; } $title = $description->render(); if ($title) { break; } } } if (Generator::UNDEFINED === $property->title && $title) { $property->title = $title; } if (Generator::UNDEFINED === $property->description && $docBlock->getDescription() && $docBlock->getDescription()->render()) { $property->description = $docBlock->getDescription()->render(); } } }