Code Duplication    Length = 11-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 5488-5498 (lines=11) @@
5485
      $haystack = self::clean($haystack);
5486
    }
5487
5488
    if (self::$support['mbstring'] === true) {
5489
5490
      // INFO: this is only a fallback for old versions
5491
      if ($encoding === true || $encoding === false) {
5492
        $encoding = 'UTF-8';
5493
      } else {
5494
        $encoding = self::normalizeEncoding($encoding);
5495
      }
5496
5497
      return \mb_strpos($haystack, $needle, $offset, $encoding);
5498
    }
5499
5500
    if (self::$support['iconv'] === true) {
5501
      // ignore invalid negative offset to keep compatility
@@ 5964-5974 (lines=11) @@
5961
      $length = (int)$length;
5962
    }
5963
5964
    if (self::$support['mbstring'] === true) {
5965
5966
      // INFO: this is only a fallback for old versions
5967
      if ($encoding === true || $encoding === false) {
5968
        $encoding = 'UTF-8';
5969
      } else {
5970
        $encoding = self::normalizeEncoding($encoding);
5971
      }
5972
5973
      return \mb_substr($str, $start, $length, $encoding);
5974
    }
5975
5976
    if (self::$support['iconv'] === true) {
5977
      return (string)\grapheme_substr($str, $start, $length);