%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/graphicd/www/vebto/vendor/roave/better-reflection/src/Util/
Upload File :
Create Path :
Current File : /home/graphicd/www/vebto/vendor/roave/better-reflection/src/Util/GetFirstDocComment.php

<?php

declare(strict_types=1);

namespace Roave\BetterReflection\Util;

use PhpParser\Comment\Doc;
use PhpParser\NodeAbstract;
use function assert;
use function is_string;

/**
 * @internal
 */
final class GetFirstDocComment
{
    public static function forNode(NodeAbstract $node) : string
    {
        foreach ($node->getComments() as $comment) {
            if ($comment instanceof Doc) {
                $text = $comment->getReformattedText();

                assert(is_string($text));

                return $text;
            }
        }

        return '';
    }
}

Zerion Mini Shell 1.0