Code Duplication    Length = 6-6 lines in 2 locations

src/voku/helper/shim/Mbstring.php 2 locations

@@ 627-632 (lines=6) @@
624
  {
625
    INF === $encoding && $encoding = self::$internal_encoding;
626
627
    if ($start < 0) {
628
      $start = iconv_strlen($str, $encoding . '//IGNORE') + $start;
629
      if ($start < 0) {
630
        $start = 0;
631
      }
632
    }
633
634
    if (null === $length) {
635
      $length = 2147483647;
@@ 636-641 (lines=6) @@
633
634
    if (null === $length) {
635
      $length = 2147483647;
636
    } elseif ($length < 0) {
637
      $length = iconv_strlen($str, $encoding . '//IGNORE') + $length - $start;
638
      if ($length < 0) {
639
        return '';
640
      }
641
    }
642
643
    return iconv_substr($str, $start, $length, $encoding . '//IGNORE') . '';
644
  }