Skip to content

Commit

Permalink
Merge pull request #39 from jeherve/fix/php8-named-parameters
Browse files Browse the repository at this point in the history
HitHighlighter Class: avoid PHP 8 errors
  • Loading branch information
nojimage authored Mar 18, 2021
2 parents 82e4bdd + 7b2a0fe commit 979bcf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## 3.1.2

- Hit highlighting: avoid errors with PHP 8.

## 3.0.0

- Pass twitter-text conformance 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion lib/Twitter/Text/HitHighlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function highlight($tweet = null, array $hits = null)
$offset = 0;
$start_in_chunk = false;
# Flatten the multidimensional hits array:
$hits_flat = call_user_func_array('array_merge', $hits);
$hits_flat = call_user_func_array('array_merge', array_values($hits));
$hits_flat_count = count($hits_flat);
# Loop over the hit indices:
for ($index = 0; $index < $hits_flat_count; $index++) {
Expand Down

0 comments on commit 979bcf6

Please sign in to comment.