Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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