Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6713-6721 (lines=9) @@
6710
      }
6711
6712
      // the offset
6713
      if (is_array($offset) === true) {
6714
        $offset = array_slice($offset, 0, $num);
6715
        foreach ($offset as &$valueTmp) {
6716
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6717
        }
6718
        unset($valueTmp);
6719
      } else {
6720
        $offset = array_pad(array($offset), $num, $offset);
6721
      }
6722
6723
      // the length
6724
      if (!isset($length)) {
@@ 6726-6736 (lines=11) @@
6723
      // the length
6724
      if (!isset($length)) {
6725
        $length = array_fill(0, $num, 0);
6726
      } elseif (is_array($length) === true) {
6727
        $length = array_slice($length, 0, $num);
6728
        foreach ($length as &$valueTmpV2) {
6729
          if (isset($valueTmpV2)) {
6730
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6731
          } else {
6732
            $valueTmpV2 = 0;
6733
          }
6734
        }
6735
        unset($valueTmpV2);
6736
      } else {
6737
        $length = array_pad(array($length), $num, $length);
6738
      }
6739