Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6809-6817 (lines=9) @@
6806
      }
6807
6808
      // the offset
6809
      if (is_array($offset) === true) {
6810
        $offset = array_slice($offset, 0, $num);
6811
        foreach ($offset as &$valueTmp) {
6812
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6813
        }
6814
        unset($valueTmp);
6815
      } else {
6816
        $offset = array_pad(array($offset), $num, $offset);
6817
      }
6818
6819
      // the length
6820
      if (!isset($length)) {
@@ 6822-6832 (lines=11) @@
6819
      // the length
6820
      if (!isset($length)) {
6821
        $length = array_fill(0, $num, 0);
6822
      } elseif (is_array($length) === true) {
6823
        $length = array_slice($length, 0, $num);
6824
        foreach ($length as &$valueTmpV2) {
6825
          if (isset($valueTmpV2)) {
6826
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6827
          } else {
6828
            $valueTmpV2 = 0;
6829
          }
6830
        }
6831
        unset($valueTmpV2);
6832
      } else {
6833
        $length = array_pad(array($length), $num, $length);
6834
      }
6835