Code Duplication    Length = 5-5 lines in 4 locations

src/voku/helper/UTF8.php 4 locations

@@ 3111-3115 (lines=5) @@
3108
      self::checkForSupport();
3109
    }
3110
3111
    if (self::$SUPPORT['mbstring_func_overload'] === true) {
3112
      $len = \mb_strlen($str, '8BIT');
3113
    } else {
3114
      $len = strlen($str);
3115
    }
3116
3117
    /** @noinspection ForeachInvariantsInspection */
3118
    for ($i = 0; $i < $len; $i++) {
@@ 4140-4144 (lines=5) @@
4137
        self::checkForSupport();
4138
      }
4139
4140
      if (self::$SUPPORT['mbstring_func_overload'] === true) {
4141
        $len = \mb_strlen($str, '8BIT');
4142
      } else {
4143
        $len = strlen($str);
4144
      }
4145
4146
      /** @noinspection ForeachInvariantsInspection */
4147
      for ($i = 0; $i < $len; $i++) {
@@ 6903-6907 (lines=5) @@
6900
      self::checkForSupport();
6901
    }
6902
6903
    if (self::$SUPPORT['mbstring_func_overload'] === true) {
6904
      $max = \mb_strlen($str, '8BIT');
6905
    } else {
6906
      $max = strlen($str);
6907
    }
6908
6909
    $buf = '';
6910
@@ 7433-7437 (lines=5) @@
7430
      self::checkForSupport();
7431
    }
7432
7433
    if (self::$SUPPORT['mbstring_func_overload'] === true) {
7434
      $len = \mb_strlen($str, '8BIT');
7435
    } else {
7436
      $len = strlen($str);
7437
    }
7438
7439
    /** @noinspection ForeachInvariantsInspection */
7440
    for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) {