Code Duplication    Length = 13-14 lines in 3 locations

Classes/Domain/Repository/ContentRepository.php 3 locations

@@ 285-298 (lines=14) @@
282
     * @param $language
283
     * @return bool
284
     */
285
    public function localize($content, $language)
286
    {
287
288
        // Security check
289
        $this->getContentValidator()->validate($content);
290
        $this->getLanguageValidator()->validate($language);
291
292
        $dataType = $content->getDataType();
293
        $handler = $this->getDataHandlerFactory()->action(ProcessAction::LOCALIZE)->forType($dataType)->getDataHandler();
294
295
        $handlerResult = $handler->processLocalize($content, $language);
296
        $this->errorMessages = $handler->getErrorMessages();
297
        return $handlerResult;
298
    }
299
300
    /**
301
     * Update a content with new information.
@@ 345-357 (lines=13) @@
342
     * @param string $target
343
     * @return bool
344
     */
345
    public function move($content, $target)
346
    {
347
348
        // Security check.
349
        $this->getContentValidator()->validate($content);
350
351
        $dataType = $content->getDataType();
352
        $handler = $this->getDataHandlerFactory()->action(ProcessAction::MOVE)->forType($dataType)->getDataHandler();
353
354
        $handlerResult = $handler->processMove($content, $target);
355
        $this->errorMessages = $handler->getErrorMessages();
356
        return $handlerResult;
357
    }
358
359
    /**
360
     * Copy a content within this repository.
@@ 365-377 (lines=13) @@
362
     * @param Content $content
363
     * @return bool
364
     */
365
    public function copy($content, $target)
366
    {
367
368
        // Security check.
369
        $this->getContentValidator()->validate($content);
370
371
        $dataType = $content->getDataType();
372
        $handler = $this->getDataHandlerFactory()->action(ProcessAction::COPY)->forType($dataType)->getDataHandler();
373
374
        $handlerResult = $handler->processCopy($content, $target);
375
        $this->errorMessages = $handler->getErrorMessages();
376
        return $handlerResult;
377
    }
378
379
    /**
380
     * Adds an object to this repository.