File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class HtmlDiff extends AbstractDiff
18
18
* @var array
19
19
*/
20
20
protected $ newIsolatedDiffTags ;
21
+
21
22
/**
22
23
* @var array
23
24
*/
@@ -116,18 +117,20 @@ public function build()
116
117
return $ this ->content ;
117
118
}
118
119
119
- protected function indexNewWords ()
120
+ protected function indexNewWords () : void
120
121
{
121
- $ this ->wordIndices = array ();
122
+ $ this ->wordIndices = [];
123
+
122
124
foreach ($ this ->newWords as $ i => $ word ) {
123
- if ($ this ->isTag ($ word )) {
125
+ if ($ this ->isTag ($ word ) === true ) {
124
126
$ word = $ this ->stripTagAttributes ($ word );
125
127
}
126
- if (isset ($ this ->wordIndices [ $ word ])) {
127
- $ this ->wordIndices [ $ word ][] = $ i ;
128
- } else {
129
- $ this ->wordIndices [ $ word ] = array ($ i );
128
+
129
+ if (isset ($ this ->wordIndices [$ word ]) === false ) {
130
+ $ this ->wordIndices [$ word ] = [];
130
131
}
132
+
133
+ $ this ->wordIndices [$ word ][] = $ i ;
131
134
}
132
135
}
133
136
You can’t perform that action at this time.
0 commit comments