Skip to content

Commit 979bcf6

Browse files
authored
Merge pull request #39 from jeherve/fix/php8-named-parameters
HitHighlighter Class: avoid PHP 8 errors
2 parents 82e4bdd + 7b2a0fe commit 979bcf6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Changes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## 3.1.2
4+
5+
- Hit highlighting: avoid errors with PHP 8.
6+
37
## 3.0.0
48

59
- Pass twitter-text conformance 3.0.0

lib/Twitter/Text/HitHighlighter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function highlight($tweet = null, array $hits = null)
141141
$offset = 0;
142142
$start_in_chunk = false;
143143
# Flatten the multidimensional hits array:
144-
$hits_flat = call_user_func_array('array_merge', $hits);
144+
$hits_flat = call_user_func_array('array_merge', array_values($hits));
145145
$hits_flat_count = count($hits_flat);
146146
# Loop over the hit indices:
147147
for ($index = 0; $index < $hits_flat_count; $index++) {

0 commit comments

Comments
 (0)