Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/extgen/classparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (cp *classParser) parse(filename string) (classes []phpClass, err error) {
}

if err := validator.validateClass(class); err != nil {
fmt.Printf("Warning: Invalid class '%s': %v\n", class.Name, err)
fmt.Fprintf(os.Stderr, "Warning: Invalid class '%s': %v\n", class.Name, err)
continue
}

Expand Down Expand Up @@ -231,7 +231,7 @@ func (cp *classParser) parseMethods(filename string) (methods []phpClassMethod,

method, err := cp.parseMethodSignature(className, signature)
if err != nil {
fmt.Printf("Warning: Error parsing method signature %q: %v\n", signature, err)
fmt.Fprintf(os.Stderr, "Warning: Error parsing method signature %q: %v\n", signature, err)

continue
}
Expand All @@ -246,7 +246,7 @@ func (cp *classParser) parseMethods(filename string) (methods []phpClassMethod,
}

if err := validator.validateTypes(phpFunc); err != nil {
fmt.Printf("Warning: Method \"%s::%s\" uses unsupported types: %v\n", className, method.Name, err)
fmt.Fprintf(os.Stderr, "Warning: Method \"%s::%s\" uses unsupported types: %v\n", className, method.Name, err)

continue
}
Expand Down Expand Up @@ -274,7 +274,7 @@ func (cp *classParser) parseMethods(filename string) (methods []phpClassMethod,
}

if err := validator.validateGoFunctionSignatureWithOptions(phpFunc, true); err != nil {
fmt.Printf("Warning: Go method signature mismatch for '%s::%s': %v\n", currentMethod.ClassName, currentMethod.Name, err)
fmt.Fprintf(os.Stderr, "Warning: Go method signature mismatch for '%s::%s': %v\n", currentMethod.ClassName, currentMethod.Name, err)
currentMethod = nil
continue
}
Expand Down
8 changes: 4 additions & 4 deletions internal/extgen/funcparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ func (fp *FuncParser) parse(filename string) (functions []phpFunction, err error
signature := strings.TrimSpace(matches[1])
phpFunc, err := fp.parseSignature(signature)
if err != nil {
fmt.Printf("Warning: Error parsing signature '%s': %v\n", signature, err)
fmt.Fprintf(os.Stderr, "Warning: Error parsing signature '%s': %v\n", signature, err)

continue
}

if err := validator.validateFunction(*phpFunc); err != nil {
fmt.Printf("Warning: Invalid function '%s': %v\n", phpFunc.Name, err)
fmt.Fprintf(os.Stderr, "Warning: Invalid function '%s': %v\n", phpFunc.Name, err)

continue
}

if err := validator.validateTypes(*phpFunc); err != nil {
fmt.Printf("Warning: Function '%s' uses unsupported types: %v\n", phpFunc.Name, err)
fmt.Fprintf(os.Stderr, "Warning: Function '%s' uses unsupported types: %v\n", phpFunc.Name, err)

continue
}
Expand All @@ -69,7 +69,7 @@ func (fp *FuncParser) parse(filename string) (functions []phpFunction, err error
currentPHPFunc.GoFunction = goFunc

if err := validator.validateGoFunctionSignatureWithOptions(*currentPHPFunc, false); err != nil {
fmt.Printf("Warning: Go function signature mismatch for %q: %v\n", currentPHPFunc.Name, err)
fmt.Fprintf(os.Stderr, "Warning: Go function signature mismatch for %q: %v\n", currentPHPFunc.Name, err)
currentPHPFunc = nil

continue
Expand Down
Loading