Code Duplication    Length = 8-8 lines in 2 locations

src/SWP/Bundle/ContentBundle/Factory/ArticleFactory.php 2 locations

@@ 109-116 (lines=8) @@
106
        return $article;
107
    }
108
109
    private function populateLead(PackageInterface $package)
110
    {
111
        return trim($package->getDescription().implode('', array_map(function (ItemInterface $item) {
112
            $this->ensureTypeIsAllowed($item->getType());
113
114
            return ' '.$item->getDescription();
115
        }, $package->getItems()->toArray())));
116
    }
117
118
    private function populateBody(PackageInterface $package)
119
    {
@@ 118-125 (lines=8) @@
115
        }, $package->getItems()->toArray())));
116
    }
117
118
    private function populateBody(PackageInterface $package)
119
    {
120
        return $package->getBody().' '.implode('', array_map(function (ItemInterface $item) {
121
            $this->ensureTypeIsAllowed($item->getType());
122
123
            return $item->getBody();
124
        }, $package->getItems()->toArray()));
125
    }
126
127
    private function ensureTypeIsAllowed($type)
128
    {