Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6618-6626 (lines=9) @@
6615
      }
6616
6617
      // the offset
6618
      if (is_array($offset) === true) {
6619
        $offset = array_slice($offset, 0, $num);
6620
        foreach ($offset as &$valueTmp) {
6621
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6622
        }
6623
        unset($valueTmp);
6624
      } else {
6625
        $offset = array_pad(array($offset), $num, $offset);
6626
      }
6627
6628
      // the length
6629
      if (!isset($length)) {
@@ 6631-6641 (lines=11) @@
6628
      // the length
6629
      if (!isset($length)) {
6630
        $length = array_fill(0, $num, 0);
6631
      } elseif (is_array($length) === true) {
6632
        $length = array_slice($length, 0, $num);
6633
        foreach ($length as &$valueTmpV2) {
6634
          if (isset($valueTmpV2)) {
6635
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6636
          } else {
6637
            $valueTmpV2 = 0;
6638
          }
6639
        }
6640
        unset($valueTmpV2);
6641
      } else {
6642
        $length = array_pad(array($length), $num, $length);
6643
      }
6644