Code Duplication    Length = 7-7 lines in 4 locations

src/voku/helper/UTF8.php 4 locations

@@ 5551-5557 (lines=7) @@
5548
      self::checkForSupport();
5549
    }
5550
5551
    if (
5552
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
5553
        &&
5554
        self::$SUPPORT['intl'] === true
5555
    ) {
5556
      return \grapheme_stripos($haystack, $needle, $offset);
5557
    }
5558
5559
    // fallback to "mb_"-function via polyfill
5560
    return \mb_stripos($haystack, $needle, $offset, $encoding);
@@ 5945-5951 (lines=7) @@
5942
      }
5943
    }
5944
5945
    if (
5946
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
5947
        &&
5948
        self::$SUPPORT['intl'] === true
5949
    ) {
5950
      return \grapheme_strpos($haystack, $needle, $offset);
5951
    }
5952
5953
    if (
5954
        $offset >= 0 // iconv_strpos() can't handle negative offset
@@ 6146-6152 (lines=7) @@
6143
      return \mb_strripos($haystack, $needle, $offset, $encoding);
6144
    }
6145
6146
    if (
6147
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
6148
        &&
6149
        self::$SUPPORT['intl'] === true
6150
    ) {
6151
      return \grapheme_strripos($haystack, $needle, $offset);
6152
    }
6153
6154
    // fallback via vanilla php
6155
@@ 6217-6223 (lines=7) @@
6214
      return \mb_strrpos($haystack, $needle, $offset, $encoding);
6215
    }
6216
6217
    if (
6218
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
6219
        &&
6220
        self::$SUPPORT['intl'] === true
6221
    ) {
6222
      return \grapheme_strrpos($haystack, $needle, $offset);
6223
    }
6224
6225
    // fallback via vanilla php
6226