Code Duplication    Length = 8-8 lines in 3 locations

src/vendor/symfony/polyfill-mbstring/Mbstring.php 3 locations

@@ 167-174 (lines=8) @@
164
165
        $encoding = self::getEncoding($encoding);
166
167
        if ('UTF-8' === $encoding) {
168
            $encoding = null;
169
            if (!preg_match('//u', $s)) {
170
                $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
171
            }
172
        } else {
173
            $s = iconv($encoding, 'UTF-8//IGNORE', $s);
174
        }
175
176
        $cnt = floor(\count($convmap) / 4) * 4;
177
@@ 233-240 (lines=8) @@
230
231
        $encoding = self::getEncoding($encoding);
232
233
        if ('UTF-8' === $encoding) {
234
            $encoding = null;
235
            if (!preg_match('//u', $s)) {
236
                $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
237
            }
238
        } else {
239
            $s = iconv($encoding, 'UTF-8//IGNORE', $s);
240
        }
241
242
        static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4);
243
@@ 281-288 (lines=8) @@
278
279
        $encoding = self::getEncoding($encoding);
280
281
        if ('UTF-8' === $encoding) {
282
            $encoding = null;
283
            if (!preg_match('//u', $s)) {
284
                $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
285
            }
286
        } else {
287
            $s = iconv($encoding, 'UTF-8//IGNORE', $s);
288
        }
289
290
        if (MB_CASE_TITLE == $mode) {
291
            static $titleRegexp = null;