diff --git a/src/Processors/DocBlockProcessor.php b/src/Processors/DocBlockProcessor.php new file mode 100644 index 0000000..9ff3b61 --- /dev/null +++ b/src/Processors/DocBlockProcessor.php @@ -0,0 +1,41 @@ +getDocComment(); + $tokens = new TokenIterator($lexer->tokenize($comment)); + $phpDocNode = $parser->parse($tokens); + + foreach ($phpDocNode->children as $child) { + if ($child instanceof PhpDocTextNode) { + $description .= ' '.$child->text; + } + } + + return Str::squish($description); + } catch (Throwable $e) { + return ''; + } + } +}