Code Duplication    Length = 21-21 lines in 2 locations

src/Yandex/SafeBrowsing/SafeBrowsingClient.php 2 locations

@@ 511-531 (lines=21) @@
508
                        continue;
509
                    }
510
                } elseif (substr_count($value, "ad:") > 0) {
511
                    if (substr_count($value, ',') > 0) {
512
                        $ranges = explode(',', trim(str_replace("ad:", "", $value)));
513
                        $rangesData = [];
514
                        foreach ($ranges as $range) {
515
                            list($min, $max) = explode('-', $range);
516
                            $rangesData[] = [
517
                                'min' => $min,
518
                                'max' => $max
519
                            ];
520
                        }
521
                        $chunksByList['delete_added_ranges'] = $rangesData;
522
                    } else {
523
                        $range = trim(str_replace("sd:", "", $value));
524
                        list($min, $max) = explode('-', $range);
525
                        $chunksByList['delete_added_ranges'] = [
526
                            [
527
                                'min' => $min,
528
                                'max' => $max
529
                            ]
530
                        ];
531
                    }
532
                } elseif (substr_count($value, "sd:") > 0) {
533
                    if (substr_count($value, ',') > 0) {
534
                        $ranges = explode(',', trim(str_replace("sd:", "", $value)));
@@ 533-553 (lines=21) @@
530
                        ];
531
                    }
532
                } elseif (substr_count($value, "sd:") > 0) {
533
                    if (substr_count($value, ',') > 0) {
534
                        $ranges = explode(',', trim(str_replace("sd:", "", $value)));
535
                        $rangesData = [];
536
                        foreach ($ranges as $range) {
537
                            list($min, $max) = explode('-', $range);
538
                            $rangesData[] = [
539
                                'min' => $min,
540
                                'max' => $max
541
                            ];
542
                        }
543
                        $chunksByList['delete_removed_ranges'] = $rangesData;
544
                    } else {
545
                        $range = trim(str_replace("sd:", "", $value));
546
                        list($min, $max) = explode('-', $range);
547
                        $chunksByList['delete_removed_ranges'] = [
548
                            [
549
                                'min' => $min,
550
                                'max' => $max
551
                            ]
552
                        ];
553
                    }
554
                }
555
            }
556