| 101 | } |
| 102 | |
| 103 | func (cp *classParser) collectExportDirectives(node *ast.File, fset *token.FileSet) []exportDirective { |
| 104 | var directives []exportDirective |
| 105 | |
| 106 | for _, commentGroup := range node.Comments { |
| 107 | for _, comment := range commentGroup.List { |
| 108 | if matches := phpClassRegex.FindStringSubmatch(comment.Text); matches != nil { |
| 109 | pos := fset.Position(comment.Pos()) |
| 110 | directives = append(directives, exportDirective{ |
| 111 | line: pos.Line, |
| 112 | className: matches[1], |
| 113 | }) |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | return directives |
| 119 | } |
| 120 | |
| 121 | func (cp *classParser) extractPHPClassCommentWithLine(commentGroup *ast.CommentGroup, fset *token.FileSet) (string, int) { |
| 122 | if commentGroup == nil { |