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)
7171 $ trimLine = trim ($ line );
7272 $ lineNo = ($ file ->key () + 1 );
7373
74- if ($ foundIndex = array_search ( $ trimLine , array_column ( $ lines, ' code ' ) )) {
75- $ foundLineNo = $ lines [$ foundIndex ][ ' lineNo ' ];
74+ if (isset ( $ lines[ $ trimLine ] )) {
75+ $ foundLineNo = $ lines [$ trimLine ];
7676 if (!in_array ($ foundLineNo , $ duplicates )) {
7777 $ duplicates [] = $ foundLineNo ;
7878 }
79- $ duplicates [] = $ lineNo ;
80- }
8179
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 ;
8784 }
8885 }
8986
You can’t perform that action at this time.
0 commit comments