docBlockFactory = $docBlockFactory; } public function describe(Swagger $api, Route $route, \ReflectionMethod $reflectionMethod) { $classDocBlock = null; $docBlock = null; try { $classDocBlock = $this->docBlockFactory->create($reflectionMethod->getDeclaringClass()); } catch (\Exception $e) { } try { $docBlock = $this->docBlockFactory->create($reflectionMethod); } catch (\Exception $e) { } foreach ($this->getOperations($api, $route) as $operation) { if (null !== $docBlock) { if (null === $operation->getSummary() && '' !== $docBlock->getSummary()) { $operation->setSummary($docBlock->getSummary()); } if (null === $operation->getDescription() && '' !== (string) $docBlock->getDescription()) { $operation->setDescription((string) $docBlock->getDescription()); } if ($docBlock->hasTag('deprecated')) { $operation->setDeprecated(true); } } if (null !== $classDocBlock) { if ($classDocBlock->hasTag('deprecated')) { $operation->setDeprecated(true); } } } } }