Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6978-6986 (lines=9) @@
6975
      }
6976
6977
      // the offset
6978
      if (\is_array($offset) === true) {
6979
        $offset = \array_slice($offset, 0, $num);
6980
        foreach ($offset as &$valueTmp) {
6981
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6982
        }
6983
        unset($valueTmp);
6984
      } else {
6985
        $offset = \array_pad([$offset], $num, $offset);
6986
      }
6987
6988
      // the length
6989
      if (null === $length) {
@@ 6991-7001 (lines=11) @@
6988
      // the length
6989
      if (null === $length) {
6990
        $length = \array_fill(0, $num, 0);
6991
      } elseif (\is_array($length) === true) {
6992
        $length = \array_slice($length, 0, $num);
6993
        foreach ($length as &$valueTmpV2) {
6994
          if (null !== $valueTmpV2) {
6995
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6996
          } else {
6997
            $valueTmpV2 = 0;
6998
          }
6999
        }
7000
        unset($valueTmpV2);
7001
      } else {
7002
        $length = \array_pad([$length], $num, $length);
7003
      }
7004