Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6797-6805 (lines=9) @@
6794
      }
6795
6796
      // the offset
6797
      if (is_array($offset) === true) {
6798
        $offset = array_slice($offset, 0, $num);
6799
        foreach ($offset as &$valueTmp) {
6800
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6801
        }
6802
        unset($valueTmp);
6803
      } else {
6804
        $offset = array_pad(array($offset), $num, $offset);
6805
      }
6806
6807
      // the length
6808
      if (!isset($length)) {
@@ 6810-6820 (lines=11) @@
6807
      // the length
6808
      if (!isset($length)) {
6809
        $length = array_fill(0, $num, 0);
6810
      } elseif (is_array($length) === true) {
6811
        $length = array_slice($length, 0, $num);
6812
        foreach ($length as &$valueTmpV2) {
6813
          if (isset($valueTmpV2)) {
6814
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6815
          } else {
6816
            $valueTmpV2 = 0;
6817
          }
6818
        }
6819
        unset($valueTmpV2);
6820
      } else {
6821
        $length = array_pad(array($length), $num, $length);
6822
      }
6823