MCPcopy Create free account
hub / github.com/php/frankenphp / parseSource

Method parseSource

internal/extgen/generator.go:56–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54}
55
56func (g *Generator) parseSource() error {
57 parser := SourceParser{}
58
59 functions, err := parser.ParseFunctions(g.SourceFile)
60 if err != nil {
61 return fmt.Errorf("parsing functions: %w", err)
62 }
63 g.Functions = functions
64
65 classes, err := parser.ParseClasses(g.SourceFile)
66 if err != nil {
67 return fmt.Errorf("parsing classes: %w", err)
68 }
69 g.Classes = classes
70
71 constants, err := parser.ParseConstants(g.SourceFile)
72 if err != nil {
73 return fmt.Errorf("parsing constants: %w", err)
74 }
75 g.Constants = constants
76
77 ns, err := parser.ParseNamespace(g.SourceFile)
78 if err != nil {
79 return fmt.Errorf("parsing namespace: %w", err)
80 }
81 g.Namespace = ns
82
83 return nil
84}
85
86func (g *Generator) generateStubFile() error {
87 generator := StubGenerator{g}

Callers 3

GenerateMethod · 0.95
TestConstantsIntegrationFunction · 0.95

Calls 4

ParseFunctionsMethod · 0.95
ParseClassesMethod · 0.95
ParseConstantsMethod · 0.95
ParseNamespaceMethod · 0.95

Tested by 2

TestConstantsIntegrationFunction · 0.76