Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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