Code Duplication    Length = 7-7 lines in 4 locations

src/voku/helper/UTF8.php 4 locations

@@ 4461-4467 (lines=7) @@
4458
      self::checkForSupport();
4459
    }
4460
4461
    if (
4462
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
4463
        &&
4464
        self::$SUPPORT['intl'] === true
4465
    ) {
4466
      return \grapheme_stripos($haystack, $needle, $offset);
4467
    }
4468
4469
    // fallback to "mb_"-function via polyfill
4470
    return \mb_stripos($haystack, $needle, $offset, $encoding);
@@ 4856-4862 (lines=7) @@
4853
      }
4854
    }
4855
4856
    if (
4857
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
4858
        &&
4859
        self::$SUPPORT['intl'] === true
4860
    ) {
4861
      return \grapheme_strpos($haystack, $needle, $offset);
4862
    }
4863
4864
    if (
4865
        $offset >= 0 // iconv_strpos() can't handle negative offset
@@ 5057-5063 (lines=7) @@
5054
      return \mb_strripos($haystack, $needle, $offset, $encoding);
5055
    }
5056
5057
    if (
5058
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
5059
        &&
5060
        self::$SUPPORT['intl'] === true
5061
    ) {
5062
      return \grapheme_strripos($haystack, $needle, $offset);
5063
    }
5064
5065
    // fallback via vanilla php
5066
@@ 5128-5134 (lines=7) @@
5125
      return \mb_strrpos($haystack, $needle, $offset, $encoding);
5126
    }
5127
5128
    if (
5129
        $encoding === 'UTF-8' // INFO: "grapheme_stripos()" can't handle other encodings
5130
        &&
5131
        self::$SUPPORT['intl'] === true
5132
    ) {
5133
      return \grapheme_strrpos($haystack, $needle, $offset);
5134
    }
5135
5136
    // fallback via vanilla php
5137