Code Duplication    Length = 7-7 lines in 2 locations

src/SWP/Bundle/ContentBundle/EventListener/ProcessArticleSlideshowsListener.php 1 location

@@ 59-65 (lines=7) @@
56
            return;
57
        }
58
59
        foreach ($package->getGroups() as $packageGroup) {
60
            foreach ($packageGroup->getItems() as $item) {
61
                if ($this->isTypeAllowed($item->getType())) {
62
                    $this->removeArticleMediaIfNeeded($item->getName(), $article);
63
                }
64
            }
65
        }
66
67
        $this->removeOldArticleSlideshows($article);
68

src/SWP/Bundle/ContentBundle/EventListener/ProcessArticleMediaListener.php 1 location

@@ 36-42 (lines=7) @@
33
        $this->removeOldArticleMedia($article);
34
35
        $guids = [];
36
        foreach ($package->getGroups() as $packageGroup) {
37
            foreach ($packageGroup->getItems() as $item) {
38
                if ($this->isTypeAllowed($item->getType())) {
39
                    $guids[] = $item->getGuid();
40
                }
41
            }
42
        }
43
44
        $items = $package->getItems()->filter(
45
            function ($entry) use ($guids) {