Code Duplication    Length = 9-9 lines in 2 locations

src/Services/LDAPService.php 2 locations

@@ 642-650 (lines=9) @@
639
                    }
640
641
                    // the user is a direct member of group with a mapping, add them to the SS group.
642
                    if ($mapping->DN == $groupDN) {
643
                        $group = $mapping->Group();
644
                        if ($group && $group->exists()) {
645
                            $group->Members()->add($member, [
646
                                'IsImportedFromLDAP' => '1'
647
                            ]);
648
                            $mappedGroupIDs[] = $mapping->GroupID;
649
                        }
650
                    }
651
652
                    // the user *might* be a member of a nested group provided the scope of the mapping
653
                    // is to include the entire subtree. Check all those mappings and find the LDAP child groups
@@ 662-670 (lines=9) @@
659
                        }
660
661
                        foreach ($childGroups as $childGroupDN => $childGroupRecord) {
662
                            if ($childGroupDN == $groupDN) {
663
                                $group = $mapping->Group();
664
                                if ($group && $group->exists()) {
665
                                    $group->Members()->add($member, [
666
                                        'IsImportedFromLDAP' => '1'
667
                                    ]);
668
                                    $mappedGroupIDs[] = $mapping->GroupID;
669
                                }
670
                            }
671
                        }
672
                    }
673
                }