Code Duplication    Length = 9-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 6525-6533 (lines=9) @@
6522
      }
6523
6524
      // the offset
6525
      if (is_array($offset) === true) {
6526
        $offset = array_slice($offset, 0, $num);
6527
        foreach ($offset as &$valueTmp) {
6528
          $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0;
6529
        }
6530
        unset($valueTmp);
6531
      } else {
6532
        $offset = array_pad(array($offset), $num, $offset);
6533
      }
6534
6535
      // the length
6536
      if (!isset($length)) {
@@ 6538-6548 (lines=11) @@
6535
      // the length
6536
      if (!isset($length)) {
6537
        $length = array_fill(0, $num, 0);
6538
      } elseif (is_array($length) === true) {
6539
        $length = array_slice($length, 0, $num);
6540
        foreach ($length as &$valueTmpV2) {
6541
          if (isset($valueTmpV2)) {
6542
            $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num;
6543
          } else {
6544
            $valueTmpV2 = 0;
6545
          }
6546
        }
6547
        unset($valueTmpV2);
6548
      } else {
6549
        $length = array_pad(array($length), $num, $length);
6550
      }
6551