Code Duplication    Length = 7-7 lines in 2 locations

main/inc/lib/groupmanager.lib.php 2 locations

@@ 2549-2555 (lines=7) @@
2546
        if ($deleteNotInArray) {
2547
            // Check categories
2548
            $categories = GroupManager::get_categories();
2549
            foreach ($categories as $category) {
2550
                if (!in_array($category['id'], $elementsFound['categories'])) {
2551
                    GroupManager::delete_category($category['id']);
2552
                    $category['category'] = $category['title'];
2553
                    $result['deleted']['category'][] = $category;
2554
                }
2555
            }
2556
2557
            $groups = GroupManager::get_groups();
2558
            foreach ($groups as $group) {
@@ 2558-2564 (lines=7) @@
2555
            }
2556
2557
            $groups = GroupManager::get_groups();
2558
            foreach ($groups as $group) {
2559
                if (!in_array($group['id'], $elementsFound['groups'])) {
2560
                    GroupManager::delete_groups(array($group['id']));
2561
                    $group['group'] = $group['name'];
2562
                    $result['deleted']['group'][] = $group;
2563
                }
2564
            }
2565
        }
2566
2567
        return $result;