Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 5973-5981 (lines=9) @@
5970
      }
5971
5972
      // the offset
5973
      if (\is_array($offset) === true) {
5974
        $offset = \array_slice($offset, 0, $num);
5975
        foreach ($offset as &$valueTmp) {
5976
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
5977
        }
5978
        unset($valueTmp);
5979
      } else {
5980
        $offset = \array_pad([$offset], $num, $offset);
5981
      }
5982
5983
      // the length
5984
      if (null === $length) {
@@ 5986-5996 (lines=11) @@
5983
      // the length
5984
      if (null === $length) {
5985
        $length = \array_fill(0, $num, 0);
5986
      } elseif (\is_array($length) === true) {
5987
        $length = \array_slice($length, 0, $num);
5988
        foreach ($length as &$valueTmpV2) {
5989
          if (null !== $valueTmpV2) {
5990
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
5991
          } else {
5992
            $valueTmpV2 = 0;
5993
          }
5994
        }
5995
        unset($valueTmpV2);
5996
      } else {
5997
        $length = \array_pad([$length], $num, $length);
5998
      }
5999