Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6745-6753 (lines=9) @@
6742
      }
6743
6744
      // the offset
6745
      if (is_array($offset) === true) {
6746
        $offset = array_slice($offset, 0, $num);
6747
        foreach ($offset as &$valueTmp) {
6748
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6749
        }
6750
        unset($valueTmp);
6751
      } else {
6752
        $offset = array_pad(array($offset), $num, $offset);
6753
      }
6754
6755
      // the length
6756
      if (!isset($length)) {
@@ 6758-6768 (lines=11) @@
6755
      // the length
6756
      if (!isset($length)) {
6757
        $length = array_fill(0, $num, 0);
6758
      } elseif (is_array($length) === true) {
6759
        $length = array_slice($length, 0, $num);
6760
        foreach ($length as &$valueTmpV2) {
6761
          if (isset($valueTmpV2)) {
6762
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6763
          } else {
6764
            $valueTmpV2 = 0;
6765
          }
6766
        }
6767
        unset($valueTmpV2);
6768
      } else {
6769
        $length = array_pad(array($length), $num, $length);
6770
      }
6771