File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -71,19 +71,16 @@ protected function processLines(SplFileObject $file)
71
71
$ trimLine = trim ($ line );
72
72
$ lineNo = ($ file ->key () + 1 );
73
73
74
- if ($ foundIndex = array_search ( $ trimLine , array_column ( $ lines, ' code ' ) )) {
75
- $ foundLineNo = $ lines [$ foundIndex ][ ' lineNo ' ];
74
+ if (isset ( $ lines[ $ trimLine ] )) {
75
+ $ foundLineNo = $ lines [$ trimLine ];
76
76
if (!in_array ($ foundLineNo , $ duplicates )) {
77
77
$ duplicates [] = $ foundLineNo ;
78
78
}
79
- $ duplicates [] = $ lineNo ;
80
- }
81
79
82
- if (strlen ($ trimLine ) > 3 ) {
83
- $ lines [] = [
84
- 'lineNo ' => $ lineNo ,
85
- 'code ' => $ trimLine ,
86
- ];
80
+ $ duplicates [] = $ lineNo ;
81
+ } else if (strlen ($ trimLine ) > 3 ) {
82
+ // Non duplicate first line
83
+ $ lines [$ trimLine ] = $ lineNo ;
87
84
}
88
85
}
89
86
You can’t perform that action at this time.
0 commit comments