Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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