Skip to content

Commit

Permalink
Removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio committed Feb 16, 2025
1 parent 0c065ee commit 05bbbd2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions src/linter/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,6 @@ func (b *blockWalker) checkConstFetchNullSafety(arg ir.Node, fn meta.FuncInfo, p
}
}

// TODO: we don't know type of each element without phpDoc, it will be mixed
func (b *blockWalker) checkArrayDimFetchNullSafety(arg ir.Node, fn meta.FuncInfo, paramIndex int, arrayExpr *ir.ArrayDimFetchExpr, haveVariadic bool) {
baseVar, ok := arrayExpr.Variable.(*ir.SimpleVar)
if !ok {
Expand Down Expand Up @@ -1156,14 +1155,12 @@ func (b *blockWalker) checkArrayDimFetchNullSafety(arg ir.Node, fn meta.FuncInfo
}
}

// TODO: we don't know type of each element without phpDoc, it will be mixed
func (b *blockWalker) checkListExprNullSafety(arg ir.Node, fn meta.FuncInfo, paramIndex int, listExpr *ir.ListExpr, haveVariadic bool) {
for _, item := range listExpr.Items {
if item == nil {
continue
}

// Если в элементе списка есть ключ, проверяем его рекурсивно.
if item.Key != nil {
b.checkNullSafetyCallArgsF([]ir.Node{item.Key}, fn)
}
Expand All @@ -1177,7 +1174,6 @@ func (b *blockWalker) checkListExprNullSafety(arg ir.Node, fn meta.FuncInfo, par
effectiveParam = fn.Params[paramIndex]
}

// Если значение элемента является простой переменной, проверяем её тип.
if simpleVar, ok := item.Val.(*ir.SimpleVar); ok {
varInfo, found := b.ctx.sc.GetVar(simpleVar)
if found && types.IsTypeNullable(varInfo.Type) {
Expand All @@ -1189,7 +1185,6 @@ func (b *blockWalker) checkListExprNullSafety(arg ir.Node, fn meta.FuncInfo, par
}
}

// Рекурсивно проверяем само выражение значения элемента списка.
b.checkNullSafetyCallArgsF([]ir.Node{item.Val}, fn)
}
}
Expand Down
1 change: 1 addition & 0 deletions src/tests/checkers/null_safety_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package checkers

0 comments on commit 05bbbd2

Please sign in to comment.