Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6676-6684 (lines=9) @@
6673
      }
6674
6675
      // the offset
6676
      if (is_array($offset) === true) {
6677
        $offset = array_slice($offset, 0, $num);
6678
        foreach ($offset as &$valueTmp) {
6679
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6680
        }
6681
        unset($valueTmp);
6682
      } else {
6683
        $offset = array_pad(array($offset), $num, $offset);
6684
      }
6685
6686
      // the length
6687
      if (!isset($length)) {
@@ 6689-6699 (lines=11) @@
6686
      // the length
6687
      if (!isset($length)) {
6688
        $length = array_fill(0, $num, 0);
6689
      } elseif (is_array($length) === true) {
6690
        $length = array_slice($length, 0, $num);
6691
        foreach ($length as &$valueTmpV2) {
6692
          if (isset($valueTmpV2)) {
6693
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6694
          } else {
6695
            $valueTmpV2 = 0;
6696
          }
6697
        }
6698
        unset($valueTmpV2);
6699
      } else {
6700
        $length = array_pad(array($length), $num, $length);
6701
      }
6702