yii\console\Controller::parseDocCommentTags PHP Method

parseDocCommentTags() protected method

Parses the comment block into tags.
protected parseDocCommentTags ( Reflector $reflection ) : array
$reflection Reflector the comment block
return array the parsed tags
    protected function parseDocCommentTags($reflection)
    {
        $comment = $reflection->getDocComment();
        $comment = "@description \n" . strtr(trim(preg_replace('/^\\s*\\**( |\\t)?/m', '', trim($comment, '/'))), "\r", '');
        $parts = preg_split('/^\\s*@/m', $comment, -1, PREG_SPLIT_NO_EMPTY);
        $tags = [];
        foreach ($parts as $part) {
            if (preg_match('/^(\\w+)(.*)/ms', trim($part), $matches)) {
                $name = $matches[1];
                if (!isset($tags[$name])) {
                    $tags[$name] = trim($matches[2]);
                } elseif (is_array($tags[$name])) {
                    $tags[$name][] = trim($matches[2]);
                } else {
                    $tags[$name] = [$tags[$name], trim($matches[2])];
                }
            }
        }
        return $tags;
    }