Code Duplication    Length = 7-7 lines in 4 locations

src/voku/helper/UTF8.php 4 locations

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