Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Brat-vseznamus committed Dec 23, 2024
1 parent 697de10 commit cf95826
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/tlcodegen/tlgen_php.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ func (gen *Gen2) PhpMarkAllInternalTypes() {
internalReachable := PHPGetAllReachableTypes(internalFunctions)
nonInternalReachable := PHPGetAllReachableTypes(nonInternalFunctions)

for wrapper, _ := range internalReachable {
for wrapper := range internalReachable {
if !nonInternalReachable[wrapper] {
wrapper.phpInfo.UsedOnlyInInternal = true
}
wrapper.phpInfo.UsedInFunctions = true
}

for wrapper, _ := range nonInternalReachable {
for wrapper := range nonInternalReachable {
wrapper.phpInfo.UsedInFunctions = true
}
}
Expand Down
6 changes: 3 additions & 3 deletions internal/tlcodegen/type_rw_struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ func (trw *TypeRWStruct) PHPStructHeader(code *strings.Builder) {
code.WriteString(fmt.Sprintf("implements %s ", unionParent.trw.PhpClassName(true, false)))
}
if trw.ResultType != nil {
code.WriteString(fmt.Sprintf("implements TL\\RpcFunction "))
code.WriteString("implements TL\\RpcFunction ")
}
code.WriteString("{\n")
}
Expand All @@ -1111,7 +1111,7 @@ func phpResultType(trw *TypeRWStruct) string {

func toPhpFieldMaskName(natName string) string {
parts := strings.Split(natName, "_")
for i, _ := range parts {
for i := range parts {
parts[i] = ToUpperFirst(parts[i])
}
return strings.Join(parts, "")
Expand Down Expand Up @@ -1171,7 +1171,7 @@ func (trw *TypeRWStruct) PhpConstructorNeedsUnion() (unionParent *TypeRWWrapper)
if trw.ResultType == nil {
if trw.wr.unionParent != nil {
return trw.wr.unionParent.wr
} else if strings.ToLower(trw.wr.tlName.Name) != strings.ToLower(trw.wr.origTL[0].TypeDecl.Name.Name) {
} else if !strings.EqualFold(trw.wr.tlName.Name, trw.wr.origTL[0].TypeDecl.Name.Name) {
// NOTE: constructor name is not same as type => type can become union in future?
return trw.wr
}
Expand Down

0 comments on commit cf95826

Please sign in to comment.