Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6632-6640 (lines=9) @@
6629
      }
6630
6631
      // the offset
6632
      if (is_array($offset) === true) {
6633
        $offset = array_slice($offset, 0, $num);
6634
        foreach ($offset as &$valueTmp) {
6635
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6636
        }
6637
        unset($valueTmp);
6638
      } else {
6639
        $offset = array_pad(array($offset), $num, $offset);
6640
      }
6641
6642
      // the length
6643
      if (!isset($length)) {
@@ 6645-6655 (lines=11) @@
6642
      // the length
6643
      if (!isset($length)) {
6644
        $length = array_fill(0, $num, 0);
6645
      } elseif (is_array($length) === true) {
6646
        $length = array_slice($length, 0, $num);
6647
        foreach ($length as &$valueTmpV2) {
6648
          if (isset($valueTmpV2)) {
6649
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6650
          } else {
6651
            $valueTmpV2 = 0;
6652
          }
6653
        }
6654
        unset($valueTmpV2);
6655
      } else {
6656
        $length = array_pad(array($length), $num, $length);
6657
      }
6658