File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ protected function compareChildLists()
197
197
break ;
198
198
} else {
199
199
// Get all the other matces for the same $key
200
- $ columns = array_column ($ bestMatchPercentages , $ key );
200
+ $ columns = $ this -> getArrayColumn ($ bestMatchPercentages , $ key );
201
201
$ thisBestMatches = array_filter (
202
202
$ columns ,
203
203
function ($ v ) use ($ percent ) {
@@ -250,6 +250,24 @@ function ($v) use ($percent) {
250
250
// Save the matches.
251
251
$ this ->textMatches = $ matches ;
252
252
}
253
+
254
+ /**
255
+ * This fuction is exactly like array_column. This is added for PHP versions that do not support array_column.
256
+ * @param array $targetArray
257
+ * @param mixed $key
258
+ * @return array
259
+ */
260
+ protected function getArrayColumn (array $ targetArray , $ key )
261
+ {
262
+ $ data = array ();
263
+ foreach ($ targetArray as $ item ) {
264
+ if (array_key_exists ($ key , $ item )) {
265
+ $ data [] = $ item [$ key ];
266
+ }
267
+ }
268
+
269
+ return $ data ;
270
+ }
253
271
254
272
/**
255
273
* Build multidimensional array holding the contents of each list node, old and new.
You can’t perform that action at this time.
0 commit comments