Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6665-6673 (lines=9) @@
6662
      }
6663
6664
      // the offset
6665
      if (is_array($offset) === true) {
6666
        $offset = array_slice($offset, 0, $num);
6667
        foreach ($offset as &$valueTmp) {
6668
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6669
        }
6670
        unset($valueTmp);
6671
      } else {
6672
        $offset = array_pad(array($offset), $num, $offset);
6673
      }
6674
6675
      // the length
6676
      if (!isset($length)) {
@@ 6678-6688 (lines=11) @@
6675
      // the length
6676
      if (!isset($length)) {
6677
        $length = array_fill(0, $num, 0);
6678
      } elseif (is_array($length) === true) {
6679
        $length = array_slice($length, 0, $num);
6680
        foreach ($length as &$valueTmpV2) {
6681
          if (isset($valueTmpV2)) {
6682
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6683
          } else {
6684
            $valueTmpV2 = 0;
6685
          }
6686
        }
6687
        unset($valueTmpV2);
6688
      } else {
6689
        $length = array_pad(array($length), $num, $length);
6690
      }
6691