Code Duplication    Length = 7-7 lines in 4 locations

src/voku/helper/UTF8.php 4 locations

@@ 4559-4565 (lines=7) @@
4556
      self::checkForSupport();
4557
    }
4558
4559
    if (
4560
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
4561
        &&
4562
        self::$SUPPORT['intl'] === true
4563
    ) {
4564
      return \grapheme_stripos($haystack, $needle, $offset);
4565
    }
4566
4567
    // fallback to "mb_"-function via polyfill
4568
    return \mb_stripos($haystack, $needle, $offset, $encoding);
@@ 4954-4960 (lines=7) @@
4951
      }
4952
    }
4953
4954
    if (
4955
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
4956
        &&
4957
        self::$SUPPORT['intl'] === true
4958
    ) {
4959
      return \grapheme_strpos($haystack, $needle, $offset);
4960
    }
4961
4962
    if (
4963
        $offset >= 0 // iconv_strpos() can't handle negative offset
@@ 5155-5161 (lines=7) @@
5152
      return \mb_strripos($haystack, $needle, $offset, $encoding);
5153
    }
5154
5155
    if (
5156
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
5157
        &&
5158
        self::$SUPPORT['intl'] === true
5159
    ) {
5160
      return \grapheme_strripos($haystack, $needle, $offset);
5161
    }
5162
5163
    // fallback via vanilla php
5164
@@ 5226-5232 (lines=7) @@
5223
      return \mb_strrpos($haystack, $needle, $offset, $encoding);
5224
    }
5225
5226
    if (
5227
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
5228
        &&
5229
        self::$SUPPORT['intl'] === true
5230
    ) {
5231
      return \grapheme_strrpos($haystack, $needle, $offset);
5232
    }
5233
5234
    // fallback via vanilla php
5235