Code Duplication    Length = 8-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 1056-1066 (lines=11) @@
1053
                ),
1054
                $trimChars
1055
            );
1056
      } else {
1057
        $extract = $replacerForSkippedText . \trim(
1058
                self::substr(
1059
                    $text,
1060
                    $pos_start,
1061
                    $pos_end,
1062
                    $encoding
1063
                ),
1064
                $trimChars
1065
            ) . $replacerForSkippedText;
1066
      }
1067
1068
    } else {
1069
@@ 1082-1089 (lines=8) @@
1079
          self::strpos($text, '.', $l, $encoding)
1080
      );
1081
1082
      if ($pos_end) {
1083
        $extract = \rtrim(
1084
                       self::substr($text, 0, $pos_end, $encoding),
1085
                       $trimChars
1086
                   ) . $replacerForSkippedText;
1087
      } else {
1088
        $extract = $text;
1089
      }
1090
    }
1091
1092
    return $extract;