diff --git a/src/Lib/Factory/PathFactory.php b/src/Lib/Factory/PathFactory.php index 63156486..7b08fda2 100644 --- a/src/Lib/Factory/PathFactory.php +++ b/src/Lib/Factory/PathFactory.php @@ -59,7 +59,7 @@ public function create() : ?Path Inflector::humanize(Inflector::underscore($defaults['controller'])) ]) ->setParameters($this->getPathParameters()) - ->setDeprecated($this->dockBlock->hasTag('deprecated')) + ->setDeprecated($this->isDeprecated()) ; $externalDoc = $this->getExternalDoc(); @@ -204,8 +204,21 @@ private function isSwaggable(string $className) : bool return true; } + private function isDeprecated() : bool + { + if (!$this->dockBlock || !$this->dockBlock instanceof DocBlock) { + return false; + } + + return $this->dockBlock->hasTag('deprecated'); + } + private function getExternalDoc() : ?OperationExternalDoc { + if (!$this->dockBlock || !$this->dockBlock instanceof DocBlock) { + return null; + } + if (!$this->dockBlock->hasTag('see')) { return null; }