MCPcopy Index your code
hub / github.com/php/frankenphp / extractPHPClassCommentWithLine

Method extractPHPClassCommentWithLine

internal/extgen/classparser.go:121–134  ·  view source on GitHub ↗
(commentGroup *ast.CommentGroup, fset *token.FileSet)

Source from the content-addressed store, hash-verified

119}
120
121func (cp *classParser) extractPHPClassCommentWithLine(commentGroup *ast.CommentGroup, fset *token.FileSet) (string, int) {
122 if commentGroup == nil {
123 return "", 0
124 }
125
126 for _, comment := range commentGroup.List {
127 if matches := phpClassRegex.FindStringSubmatch(comment.Text); matches != nil {
128 pos := fset.Position(comment.Pos())
129 return matches[1], pos.Line
130 }
131 }
132
133 return "", 0
134}
135
136func (cp *classParser) parseStructFields(fields []*ast.Field) []phpClassProperty {
137 var properties []phpClassProperty

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected