Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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