Code Duplication    Length = 12-14 lines in 2 locations

Classes/Service/Manager.php 2 locations

@@ 165-176 (lines=12) @@
162
     *
163
     * @return array
164
     */
165
    protected function initializeResources(Strategy $strategy, $filepath)
166
    {
167
        $resources = [];
168
        $resourceConfiguration = $strategy->getResources();
169
        foreach ($resourceConfiguration as $resource => $configuration) {
170
            $object = $this->objectManager->get($resource);
171
            $object->start($strategy, $filepath);
172
            $object->setConfiguration($configuration);
173
            $resources[$resource] = $object;
174
        }
175
        return $resources;
176
    }
177
178
    /**
179
     * @param \HDNET\Importr\Domain\Model\Import $import
@@ 183-196 (lines=14) @@
180
     *
181
     * @return array
182
     */
183
    protected function initializeTargets(Import $import)
184
    {
185
        $targets = [];
186
        $targetConfiguration = $import->getStrategy()
187
            ->getTargets();
188
        foreach ($targetConfiguration as $target => $configuration) {
189
            $object = $this->objectManager->get($target);
190
            $object->setConfiguration($configuration);
191
            $object->getConfiguration();
192
            $object->start($import->getStrategy());
193
            $targets[$target] = $object;
194
        }
195
        return $targets;
196
    }
197
198
    /**
199
     * @param \HDNET\Importr\Domain\Model\Import $import