Code Duplication    Length = 5-5 lines in 4 locations

src/voku/helper/UTF8.php 4 locations

@@ 3158-3162 (lines=5) @@
3155
      self::checkForSupport();
3156
    }
3157
3158
    if (self::$SUPPORT['mbstring_func_overload'] === true) {
3159
      $len = \mb_strlen($str, '8BIT');
3160
    } else {
3161
      $len = strlen($str);
3162
    }
3163
3164
    /** @noinspection ForeachInvariantsInspection */
3165
    for ($i = 0; $i < $len; $i++) {
@@ 4314-4318 (lines=5) @@
4311
        self::checkForSupport();
4312
      }
4313
4314
      if (self::$SUPPORT['mbstring_func_overload'] === true) {
4315
        $len = \mb_strlen($str, '8BIT');
4316
      } else {
4317
        $len = strlen($str);
4318
      }
4319
4320
      /** @noinspection ForeachInvariantsInspection */
4321
      for ($i = 0; $i < $len; $i++) {
@@ 7240-7244 (lines=5) @@
7237
      self::checkForSupport();
7238
    }
7239
7240
    if (self::$SUPPORT['mbstring_func_overload'] === true) {
7241
      $max = \mb_strlen($str, '8BIT');
7242
    } else {
7243
      $max = strlen($str);
7244
    }
7245
7246
    $buf = '';
7247
@@ 7807-7811 (lines=5) @@
7804
      self::checkForSupport();
7805
    }
7806
7807
    if (self::$SUPPORT['mbstring_func_overload'] === true) {
7808
      $len = \mb_strlen($str, '8BIT');
7809
    } else {
7810
      $len = strlen($str);
7811
    }
7812
7813
    /** @noinspection ForeachInvariantsInspection */
7814
    for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) {