Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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